Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

ActionForms & Struts

Thread view: 
gwoodhouse@gmail.com - 20 Nov 2007 10:10 GMT
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
gwoodhouse@gmail.com - 20 Nov 2007 10:15 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.

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.