File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 41519
    
  53
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: 41519
    
  53
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Looking for framework that can generate html forms from java objects