Shhh! Script it with PERL in 10 minutes... SHH!
Don't let the group know I was previously into
PERL, before Java programming. LOL.

Regards,
David

-----Original Message-----
From: Dionisius Purba [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 4:24 AM
To: 'Struts Users Mailing List'
Subject: RE: generate struts ActionForm & strut's jsp from hibernate's
mapping


David, you're right that I oversimplified the situation regarding
the HTML Input's type,
For my situations, the inputs in JSPs will be put between

<tr>
<td class="myclass"><html:text property="firstName"></td>
</tr>
etc.
The <tr> and <td> and it's closing tags will be generated too
to minimize copy & pasting (the jsp phsycial file itself
would be generated automatically).
It happened that there are lots of JSPs to generates, more than 100 JSPs,
so I hope if I decided to do that, it wont be too counterproductive.

I've never use map-backed ActionForm before, I'll look at it then.
Thanks for your opinions.

regards,
~dion

-----Original Message-----
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 2:03 PM
To: Struts Users Mailing List
Subject: RE: generate struts ActionForm & strut's jsp from hibernate's
mapping


I'd be incredibly surprised if someone wrote a program (or ant task) to
auto-create a basic JSP listing html:whatever tags.  How could a programmer
know from the *.hbm.xml file if a field should be a checkbox, a radio
button, an input field, a file upload, a textarea, or anything else?  If it
did make them all html:text tags, you would still have to cut/paste
everything around the page into your layout (or into another JSP which
contains your table layout).  It sounds counterproductive when I try to
envision the JSP creator in this wording. :(

Regardless, I hope you find it.

If you're looking for a String-based form, why not use a map-backed
actionForm and let BeanUtils.copyProperties() (or whatever it's called) copy
and convert the Strings into your Hibernate saveable/updatable object?  See:

http://jakarta.apache.org/struts/userGuide/building_controller.html#map_acti
on_form_classes

On the JSP issue, I personally think you're nuts (unless you've got a
simpler description than my guess above) unless you have tens or hundreds of
JSP's to make and have no layout you require (as it would require nearly
equivalent amounts of cutting & pasting).

Regards,
David

-----Original Message-----
From: Dionisius Purba [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 1:40 AM
To: 'Struts Users Mailing List'
Subject: RE: generate struts ActionForm & strut's jsp from hibernate's
mapping


David, It works perfectly fine.
You see, based on, for instance, Person.hbm.xml,
hbm2java will generate Person.java
but since I use struts, I still need to generate PersonForm.java
and Person.jsp

PersonForm would be very similar to Person.java, with the difference is that
in PersonForm, all fields's type (firstName, lastName, age)
become String.

Then in the AddPerson.jsp I will have something repeated like this:
<html:text property="firstName"/>
<html:text property="lastName"/>
<html:text property="age"/>

Is there anyone outthere who makes tool for such thing?
It should not be very difficult to make one, but I just want to avoid
reinvent the wheel.

regards,
Dion

-----Original Message-----
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 1:30 PM
To: Struts Users Mailing List
Subject: RE: generate struts ActionForm & strut's jsp from hibernate's
mapping


What's wrong with the hibernate extension tools
and the Code Generator that creates .java files from
the hbm.xml files you give it?

See:
http://prdownloads.sourceforge.net/hibernate/?sort_by=date&sort=desc
Item: hibernate-extensions-2.1.zip (or the 2.0.2 zip file for 2.0.X
versions)

I've only used the extension's hbm2java program, not the other way around.
Now that I'm using Xdoclet, I have no further need for those extension
tools.

Regards,
David

-----Original Message-----
From: Dionisius Purba [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 1:21 AM
To: 'Struts Users Mailing List'
Subject: generate struts ActionForm & strut's jsp from hibernate's
mapping


Altough my question is related to hibernate, I hope it's still relevant.
Is anyone aware of tools, open source is better, that can generate
ActionForm and the JSP's (containing struts's HTML Input tag)
based on a hibernate's mapping (i.e. *.hmb.xml)?

cheers,
dion

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to