Dion,

This is possible to do using Xdoclet's templating language. I hacked up a set of 
Xdoclet templates to create my form beans from the
Hibernate Xdoclet markkup.

For each entity object, it creates a JSP, form bean, action, manager object (DAO) and 
the associated bits. Entity references have
selection popups, and so on. It allowed us to get an application up and running very 
quickly. Granted working with a page/screen per
entity object is not ideal and can be a little cumbersome when configuring application 
entries - but it worked. We only had to
create one custom screen for results entry and several to create the charts our 
application produces. Since then we have slowly
replace many of these basic forms with custom forms that update several related 
objects. But we still use the basic generated forms
for rarely used configuration objects - it is just not worth the labor to do a custom 
screen for them.

BTW, I used Matt Raible's AppFuse application for inspiration and a starting point, 
which also builds upon ideas Erik Hatcher's book
Java Development with Ant.

Now, the down side :)

1) I say "hacked" up, because the right way would have been to spend a little more 
time understanding Xdoclet and have written the
correct Java support classes. Using just the template language, I have much, much 
repetitious code.  My intention is to completely
re-write the generation at some point in the future - but now sure when. For now I've 
got a hacked up, working prototype that does
what I need - but it would not work for others without a lot of work.

2) I made a lot of assumptions based on the limited set of data types in my 
application and my application domain model. Its a very
rich, multi-object domain with lots of inheritance - but I'm sure my assumptions do 
not apply to many, many situations - e.g. how I
handle referenced collections, object selection, date choosers, etc.

So, the point of my response is that this can be done, Xdoclet is a very flexible 
tool. You'll get good results quickly, especially
if you limit your scope and do not try to generate every possible form, just the 80% 
that are really repetitive.

I notice that some others have suggested other solutions - these may be much closer to 
a ready-to-use solution. Good luck.

 - Richard

-----Original Message-----
From: Dionisius Purba [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 22, 2004 10:21 PM
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]

Reply via email to