Hi
This is probably a really simple problem, and only seems insoluble because I'm tired from programming for too long in a row, but...
I have an ActionForm, which I use to pre-populate a form in a
JSP page. I expected that the ActionFormwould then use the data in the html form (suitably modified by the user input) and the newly populated form would then be passed back to the Action. However, what actually happens is that while the form is pre-populated properly, when I hit submit the reset method is called, and the Action gets an empty ActionForm. Here are the relevant code snippets. Does anyone have any suggestions?
JSP fragment:
<html:form action="saveMessageBody.do" >
MessageText: <html:textarea rows="4" cols="40" property="messageText"/><br>
<html:hidden property ="messageBodyId" />
<html:hidden property ="jobID" />
<html:submit property="submit" value="Submit"/>
</html:form>
struts-config.xml
<form-bean name="messagebodyForm"
type="au.com.apwd.wireless.data.MessageBodyData"/>
...
<forward name="/do/editAMessage"
contextRelative="true"
path="/do/editAMessage"
redirect="false"/>
<forward name="/do/saveMessageBody"
contextRelative="true"
path="/do/saveMessageBody"
redirect="false"/>
...
<action path="/editAMessage"
type="au.com.apwd.wireless.web.actions.EditAMessageAction"
input="/viewAJob.do"
name="messagebodyForm"
scope="session">
<forward name="login" path="/login.jsp"/>
<forward name="success" path="/pages/admin/editAMessage.jsp"/>
<forward name="failure" path="/pages/error.jsp"/>
</action>
<action path="/saveMessageBody"
type="au.com.apwd.wireless.web.actions.SaveMessageBodyAction"
input="/editAMessage.do"
name="messagebodyForm"
scope="session">
<forward name="login" path="/login.jsp"/>
<forward name="success" path="/do/viewAJob"/>
<forward name="failure" path="/pages/error.jsp"/>
</action>
There isn't anything at all interesting about the Action (hjust mutators and reset(...)) or the ActionForm, so I omit them.
Any thoughts at all?