Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Looking for framework that can generate html forms from java objects

 
Jochen Szostek
Ranch Hand
Posts: 42
Android Google Web Toolkit Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Do you mean something like Jakarta ECS?

Not sure about the other direction (HTML to Java) - how would that work?
 
Jochen Szostek
Ranch Hand
Posts: 42
Android Google Web Toolkit Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
Android Google Web Toolkit Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic