This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LazyValidatorForm and Lazy DynaBean

 
Saathvik Reddy
Ranch Hand
Posts: 228
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to display a dynamic JSP page.
Input fields(radio,select,textbox) on JSP page are displayed dynamically depending on the user actions on the JSP page.
for this I configured LazyValidatorForm for myForm in struts-config.xml.

struts-config.xml has
<form-beans>
<form-bean name="myForm" type="org.apache.struts.validator.LazyValidatorForm"/>
</form-beans>

in action class i am doing
DynaBean myForm = (DynaBean) form;

i know i can do this to get the values
String custNo = (String)myForm.get("blah");

but i cant do this becoz i shd have 1000's of such get methods.
Is there any other way to get the values from DynaBean.

Thanks in advance,
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the values are stored in a java.util.Map, you could get all the mapping entries using map.entrySet(). This produces a List whose elements are of type Map.Entry. You could then iterate through this list and get the values one by one.
[ March 01, 2006: Message edited by: Merrill Higginson ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic