This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Looking for framework that can generate html forms from java objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Looking for framework that can generate html forms from java objects" Watch "Looking for framework that can generate html forms from java objects" New topic
Author

Looking for framework that can generate html forms from java objects

Jochen Szostek
Ranch Hand

Joined: Mar 23, 2008
Posts: 42

Hi all,

Does anybody know of a framework that can generate a html form from a simple java object? And even vice versa?

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41060
    
  43
Welcome to JavaRanch.

Do you mean something like Jakarta ECS?

Not sure about the other direction (HTML to Java) - how would that work?


Ping & DNS - my free Android networking tools app
Jochen Szostek
Ranch Hand

Joined: Mar 23, 2008
Posts: 42

Thanks, i'm going to check out the ECS framework right away.

Well in php i've written code for dynamically generated forms that worked in both ways. (form to object and object to form) But it was really simple, I just used the name of the form for the name of the object and the content of textfields and text area's as string variables inside the object etc...
Of course this isn't straight forward for complex structures but I'm hoping to get this done for simple forms/objects somehow.

Thanks for the info!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41060
    
  43
I see. Now I think I understand better what you're looking for, and it most likely is not something like ECS.

Some web frameworks perform binding of form parameters to Java objects and vice versa, e.g. Stripes. If the forms in the JSP pages conform to certain standards, upon form submission their data will be bound to so-called action beans. Have a look at the Stripes Quick Start Guide; starting at "My First Stripe" is an example of how this may be brought about.

Other web frameworks (e.g. Struts) have similar mechanisms.
Jochen Szostek
Ranch Hand

Joined: Mar 23, 2008
Posts: 42

Ah thanks a lot!!I'm going to check out Struts first (because it's a commonly used framework and it's good for gaining some experience working with it(I work as an IT consultant so I guess my boss would appreciate that)).

If Struts doesn't offer me what I'm looking for I will try to go for Stripes.

And if that wouldn't suit my needs, the ECS framework would be useful if I'd create my own kind of mapping system I guess.

I also found this devsphere framework but I it's not free:
http://www.devsphere.com/mapping/docs/guide/formspec.html

Thanks again for the info and have a nice one!

greets
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Looking for framework that can generate html forms from java objects
 
Similar Threads
New to J2EE
How can a Swing-based framework be done for various users without jdk installed?
write to text file in tabular form
HTML generation from java beans
is there any way to generate a TREE / Graph like image by java ?