I have a web form that includes several dropdown menus that must be
populated dynamically from a database. I am using an Action called
EditUserAction to setup the appropriate name value pairs for the dropdown
menus. I am building the name value pairs as simple String arrays which I
place in the request scope:

 

request.setAttribute("startPageValues", startPageLabels);

request.setAttribute("startPageLabels", startPageValues);

 

When the action is complete it forwards processing to a JSP page which
displays the form: /WEB-INF/jsp/editUser.jsp. In this JSP I have the
following STRUT tag:

 

<html:select property="startPage" styleClass="clear-select-menus">

            <html:options name="startPageValues" labelName="startPageLabels"
/>

</html:select>

 

The form submits to the STRUTS controller and is configured to use an Action
called ProcessEditUserAction. This all works perfectly and without a hitch.

 

If I program the FormBean that these series of pages are using to validate
the user submitted code - when there is an error, the FormBean is being sent
to the /WEB-INF/jsp/editUser.jsp page without the name/value array pairs
being generated. This then causes some problems. How do I architecturally
handle this? My struts-config.xml file is pointing to
"/WEB-INF/jsp/editUser.jsp" as the input mapping. Should that be different?
If I do the validation in the FormBean, it seems like I can't get flow of
control back to an Action? Am I missing something?

 

Thanks!!!

 

Joe Krause

Reply via email to