Two possible solutions:
1. On the "save" action, use input="/person/add" so that when validation fails control is forwarded back through the action, which can then set up the request attributes again.
- problem: I use the same page from an "edit" action, which takes a "person id" parameter and pre-fills the form. If I do it this way I will need two "save" actions, one that uses the "edit" page as the input and one that uses the "add" page as the input. Then the form can't be shared, because I the submit action will need to change depending on whether it is an add or an edit.
2. Store the attributes in the session instead of the request.
- problem: if the user has two browser windows open to the same form then the values displayed in the page could be wrong because they are shared
- problem: these attributes won't get removed later from the request (without a lot of work on my part)
Has anyone else encountered this problem? How do most people do this?
Thanks!
This is roughly what my struts-config setup looks like:
<action path="/person/add"
type="mypackage.PersonAction"
name="PersonalInfoForm"
scope="request"
validate="false"
parameter="personalInfoFormBlank">
<forward name="continue" path="/WEB-INF/docs/jsp/person/personalInfoForm.jsp"/> </action>
<action path="/person/edit"
type="mypackage.PersonAction"
name="PersonalInfoForm"
scope="request"
validate="false"
parameter="personalInfoFormFilled">
<forward name="continue" path="/WEB-INF/docs/jsp/person/personalInfoForm.jsp"/> </action>
<action path="/person/savePersonalInfo"
type="mypackage.PersonAction"
name="PersonalInfoForm"
scope="request"
input="/WEB-INF/docs/jsp/person/personalInfoForm.jsp"
parameter="personalInfoFormSubmit">
<forward name="continue" path="/app/main"/>
</action>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

