You could do redirection after your first action. myFirstAction.jsp : form + submit buton to MyFirstAction.process()
MyFirstAction { private String myAttribute; execute() : initialize myAttribute and redirect to "success" = myFirstAction.jsp process() : do stuff on myAtrribute submitted in myFirstAction.jsp, store it in session, redirect to "second" getter/setter for myAttribute } MySecondAction { private String myAttribute; execute() : initialize myAttribute with what has been store in session for exemple, return "success" getter/setter for myAttribute } the struts.xml: <action name="goFirst" class="com.myorg.MyFirstAction"> <result name="success"> /jsp/myFirstAction.jsp </result> <result name="second" type="redirectAction"> goSecond </result> </action> <action name="goSecond" class="com.myorg.MySecondAction"> <result name="success"> /jsp/mySecondAction.jsp </result> </action> Session A Mwamufiya wrote: > > Hi, > > I have a page with input fields, and would like my action to populate > those fields before they get displayed. This page is handled by a certain > action, but it is the result page from a different action (I click on a > button in the previous action form, and this one gets called up). I put > some logging in my code, and see that the execute() method never gets > called before the page is displayed. > > This is what my form looks like: > <s:form action="SMIGCreation" target="SMIGEditor"> > <s:textfield name="smigVersion" label="%{getText('smigVersion')}" /> > <s:textfield name="smigDesc" label="%{getText('smigDesc')}" /> > <s:submit key="saveButton" method="saveButtonPressed" /> > </s:form> > > Any ideas? > > Thanks, > Session > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/populating-input-fields-on-page-load-tf4223102.html#a12014964 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]