• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

LazyValidatorForm and Lazy DynaBean

 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic