File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSF and Dynamic Forms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSF and Dynamic Forms" Watch "JSF and Dynamic Forms" New topic

JSF and Dynamic Forms

Michael Sullivan
Ranch Hand

Joined: Dec 26, 2003
Posts: 235
I apologize for my ignorance. That said, I've just had a primer to struts via my workplace, and last night I sat down with one of the few JSF texts at my local bookstore. One of the issues I face regularly is dynamic forms, created via values from a database. Struts handled this by using hash tables. How does JSF handle them?

Bill Dudney
Ranch Hand

Joined: Sep 05, 2003
Posts: 234
Hi Michael,
JSF will work quite well with data fetched from the db. One place in the JSF spec to look at is the UIData component.
If you are referring to the concept of DynaActionForms in Struts then there is nothing specifically in place to replace DynaActionForms. However achieving the same effect is relatively easy with the EL syntax for value references. You could for example use #{myBean.dynaProps[attr1]} which would ask the bean 'myBean' for a Map with getDynaProps then issue a get with attr1 as the key.
In my opinion the Dyna* stuff in Struts always seemed like a hack to get around inflexibility. Just my $0.02 worth though...
Hope this helps.

TTFN,<br /> <br />-bd-<br /> <br /><a href="" target="_blank" rel="nofollow">Jakarta Pitfalls</a> | <a href="" target="_blank" rel="nofollow">J2EE AntiPatterns</a> | <a href="" target="_blank" rel="nofollow">Mastering JavaServer Faces</a> | <a href="" target="_blank" rel="nofollow">Blog</a> | <a href="" target="_blank" rel="nofollow">Eclipse Blog</a> | <a href="" target="_blank" rel="nofollow">Eclipse 3 Live</a>
I agree. Here's the link:
subject: JSF and Dynamic Forms
It's not a secret anymore!