ActionForms & Struts

G

gwoodhouse

Hi, I'm having trouble with values falling out of my form before it
reaches the action.

Through all yesterday i figured out if i turned off one of my filters,
the form doesnt get cleared. However, nothing in that filter is
failing and it doesnt even have scope to the form so i am not sure how
its effecting the action.

Has anyone had any similar experience with a problem like this?

I would really value any advice or suggestions anyone might make - im
well and truley stumped.

Graeme
 
G

gwoodhouse

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
 
L

Lew

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.
 
T

Tim Slattery

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top