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,
posted 10 years ago
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 ]