As a follow up question,
Does anyone know the location of the "ActionForm" object in the
request object? If i can check its status in one of the filters, that
would be really useful.
Graeme
Lew - 20 Nov 2007 14:11 GMT
> Does anyone know the location of the "ActionForm" object in the
> request object? If i can check its status in one of the filters, that
> would be really useful.
I may be mistaken, but I don't think the ActionForm is in the request object.
It's manufactured by the controller servlet.

Signature
Lew
Tim Slattery - 20 Nov 2007 14:35 GMT
>As a follow up question,
>
>Does anyone know the location of the "ActionForm" object in the
>request object? If i can check its status in one of the filters, that
>would be really useful.
I don't know what you mean by "request object". The ActionForm is
passed to the execute method of your Action object in the "form"
parameter. You have to define the FormBean (an ActionForm) in the
struts-config.xml file (assuming you're using Struts 1.x).
Example: code from struts-config.xml:
<form-beans>
<form-bean name="EntryFormBean"
type="gov.bls.idcf.ces.struts.EntryFormBean">
</form-bean>
</form-beans>
<action-mappings>
<action path="/entryForm"
type="gov.bls.idcf.ces.struts.EntryFormAction"
name="EntryFormBean"
scope="request"
input="/index.jsp">
<forward name="FormABCE" path="/content/cesform_abce.jsp"
redirect="false"/>
<forward name="FormGS" path="/content/cesform_gs.jsp"
redirect="false"/>
<forward name="PayGroup" path="/content/PayGroups.jsp"
redirect="false"/>
</action>
</action-mappings>
When a jsp page submits to "entryForm.do" the Struts applet looks up
this action entry, finds that you've specified "EntryFormBean", finds
the form-beans entry for that, instantiates that bean and fills it
with the contents of the form. It then finds EntryFormAction
(specified in "type"), calls the "execute" method of that object and
passes that bean (among other things) as an argument.

Signature
Tim Slattery
Slattery_T@bls.gov
http://members.cox.net/slatteryt