views:

199

answers:

3

Is there a tool that will take you java beans (pojos) and automatically make them a form for a webpage?

To be more clear I have a bunch of Jaxb objects that I want to be able to display in a form without having to code a bunch of html. Is there a tool that will read the jaxb objects and generate the editable form for me? Also, this needs to run on a glassfish server...

+1  A: 

I presume that the question was intended to be

'How do I render a HTML form that represents all of the fields for a given bean - this will save me from having to manually typing the HTML'

Theoretically, this is possible through reflection, but it's always tricky to know which fields should be included, so the results would not always be what you intended.

Can you confirm the motives behind the question?

belugabob
Yes you are right, all the time I have been waiting and searching for an answer I could have made the forms. This is for internal use, so all the bean info should be displayed.
arinte
In that case, reflection does seem to be the answer to your problem. You should also be able to generate the labels for each field - although they may not be as grammatically correct as you'd like.I once used a similiar technique to log all fields of a bean, and this was quite successful.
belugabob
+2  A: 

If I interpret your question quite literally, then you should take a look at the ROMA framework: http://www.romaframework.org/. It tries to take POJOs (beans) which are annotated and automatically generate user interfaces.

Dave
+1  A: 

Have a look at Grails, in particular Scaffolding. It's a Groovy framework, but your POJOs will plug straight in.

Dan Vinton