You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nick Airey <Ni...@citria.com> on 2000/10/10 17:01:06 UTC
Questions on multipage forms
To: Kevin Duffey
Kevin,
Thank you for your excellent explanation and source code on multipage forms.
I have just a few additional questions:
Firstly, I assume that you are not using the struts "ActionBase" class
because you don't need/use the utility methods getLocale(), etc.
Next, if you are in a position to, could you please provide the source code
to the ActionContext class, so that myself and others don't have to recode
the same thing. If not, I guess that the interface is the 5 parameter
constructor, and the methods getCommand(), returning the command as string.
What does the method getClass() return ?
Next, it occurs to me that the jsp fragment <input type="submit" value="x"
onclick="y" > could probably end up in a custom tag since it seems to be
used at lot. Is there any reason not to do this ?
Finally, a question about the scope of the form bean. As I understand it,
the whole idea of implementing multipage forms is to use only a single
instance of a "form" bean, which is filled in across several pages. I am
unsure as to where the bean is instantiated, what its scope is, and how it
is kept available across multiple pages. Is it instantiated when the jsp
engine sees a struts:form tag as in the code from the example application
code below ? If so, how is that form instance accessed from the next jsp
page ? Also I assume that the validate() method is run only after the final
page, which has a "normal" struts:submit tag. Is this correct ?
Thanks and kind regards,
Nick
...extract from example struts application...
<struts:form action="logon.do" name="logonForm" focus="username"
type="org.apache.struts.example.LogonForm">
<table border="0" width="100%">
<tr>
<th align="right">
<struts:message key="prompt.username"/>
</th>
<td align="left">
<struts:text property="username" size="16" maxlength="16"/>
</td>
</tr>
// .... stuff removed here for clarity....
<tr>
<td align="right">
<struts:submit property="submit" value="Submit"/>
</td>
<td align="left">
<struts:reset/>
</td>
</tr>
</table>
</struts:form>
If you are not the addressee of this confidential e-mail and any
attachments, please delete it and inform the sender; unauthorised
redistribution or publication is prohibited. Views expressed are those of
the author and do not necessarily represent those of Citria Limited.