a jsp Person.jsp, a form PersonForm.class 2 actions PersonDisplay.class and PersonProcess.class mapped to the same form.
struts-config:
<form-bean name="testForm" type="pak.PersonForm" />
<action name="testForm" path="/PersonDisplay" scope="request" type="pak.PersonDisplayAction" validate="false">
<forward name="success" path="Person.jsp" />
</action>
<action name="testForm" path="/PersonProcess" input="/PersonDisplay.do" scope="request" type="pak.PersonDisplayAction" validate="true">
<forward name="display" path="/PersonDisplay.do" />
</action>
The request first hits the /PersonDisplay and renders the Person.jsp with a populated form, when submitted it comes to /PersonProcess action which modifies some values in the form and sends it back to /PersonDisplay if required.
problems:
1. what ever is displayed on the JSP with a <bean:write> from the form bean properties are not carried to /PersonProcess in the form bean. How to handle this problem. The bean needs to be in request scope. Can I carry forward the content of the form bean without making the scope session as it would mess with other request to the /PersonDisplay from the same session.
2. I modify some property in the form bean inside /PersonProcess before pasing to the /PersonDisplay but before reaching /PersonDisplay struts resets the form and re-populates the form bean with request parameters overwriting all modifications done in process. How to get rid of this automatic repopulation while forwarding it from another action.
struts-config:
<form-bean name="testForm" type="pak.PersonForm" />
<action name="testForm" path="/PersonDisplay" scope="request" type="pak.PersonDisplayAction" validate="false">
<forward name="success" path="Person.jsp" />
</action>
<action name="testForm" path="/PersonProcess" input="/PersonDisplay.do" scope="request" type="pak.PersonDisplayAction" validate="true">
<forward name="display" path="/PersonDisplay.do" />
</action>
The request first hits the /PersonDisplay and renders the Person.jsp with a populated form, when submitted it comes to /PersonProcess action which modifies some values in the form and sends it back to /PersonDisplay if required.
problems:
1. what ever is displayed on the JSP with a <bean:write> from the form bean properties are not carried to /PersonProcess in the form bean. How to handle this problem. The bean needs to be in request scope. Can I carry forward the content of the form bean without making the scope session as it would mess with other request to the /PersonDisplay from the same session.
2. I modify some property in the form bean inside /PersonProcess before pasing to the /PersonDisplay but before reaching /PersonDisplay struts resets the form and re-populates the form bean with request parameters overwriting all modifications done in process. How to get rid of this automatic repopulation while forwarding it from another action.