PillePalle23
Programmer
hi,
i have a DynaValidatorForm and a jsp-page to display the form data. in the jsp page i´m using some combo boxes. i have one action class and this action class does all the actions for this single jsp page and it extends MappingDispatchAction class.
to initialize my combo boxes with values i have a prepare function in the action class and i´m using e.g. request.setAttribute("countries", countryNames) to set the bean for htmlptions. countryNames is an array of Strings.
before i had a DynaActionForm where i havn´t done any validation and everything worked fine. i changed to DynaValidatorForm and added the appropriate settings in struts-config.xml, validator.xml and MessageResources.properties. then i wanted to test the validation. it works fine and i got the proper error messages.
but after submitting the form with wrong input and returning to the jsp-page i get the following exception:
javax.servlet.jsp.JspException: Cannot find bean under name countries at org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:374)
the page is displayed correctly to the first htmlptions statement. on top of the page i see the error messages of the validator and in tomcat i see the exceptions. after submitting the form with wrong input the validator redirects me back to the form page but then the beans i´ve set with request.setAttribute() are gone.
is there any possibility to set the beans with request.setAttribute() again? what do i have to do?
thank you
greetz
philippe
i have a DynaValidatorForm and a jsp-page to display the form data. in the jsp page i´m using some combo boxes. i have one action class and this action class does all the actions for this single jsp page and it extends MappingDispatchAction class.
to initialize my combo boxes with values i have a prepare function in the action class and i´m using e.g. request.setAttribute("countries", countryNames) to set the bean for htmlptions. countryNames is an array of Strings.
before i had a DynaActionForm where i havn´t done any validation and everything worked fine. i changed to DynaValidatorForm and added the appropriate settings in struts-config.xml, validator.xml and MessageResources.properties. then i wanted to test the validation. it works fine and i got the proper error messages.
but after submitting the form with wrong input and returning to the jsp-page i get the following exception:
javax.servlet.jsp.JspException: Cannot find bean under name countries at org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:374)
the page is displayed correctly to the first htmlptions statement. on top of the page i see the error messages of the validator and in tomcat i see the exceptions. after submitting the form with wrong input the validator redirects me back to the form page but then the beans i´ve set with request.setAttribute() are gone.
is there any possibility to set the beans with request.setAttribute() again? what do i have to do?
thank you
greetz
philippe