aspose file tools*
The moose likes Struts and the fly likes Is ActionForm is mandatory in writing Action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Is ActionForm is mandatory in writing Action class" Watch "Is ActionForm is mandatory in writing Action class" New topic
Author

Is ActionForm is mandatory in writing Action class

sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
hi all,

Is ActionForm is mandatory in writing an Action class?
thanks in advance
saiprasanna
ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
if you are talking about execute methord , then its necessary to use ActionFor m there
Raghavendra nandavar
Ranch Hand

Joined: Jun 26, 2005
Posts: 231
Originally posted by sai prasanna:
hi all,

Is ActionForm is mandatory in writing an Action class?
thanks in advance
saiprasanna


If you are talking about writing a seperate class for action form bean,
then there is another option where in, you need not write any action form
classes, you can use what is known as the DynaActionForms which are
present in the org.apache.struts.action package.

Instead of specifying your actionform in the struts-config.xml, you
can specify the type as org.apache.struts.action.DynaActionForm, and
declare the form properties.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026

Is ActionForm is mandatory in writing an Action class?


Could you be more specific?


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The short answer to this question is no, an ActionForm is not necessary for an action. If you specifiy

<action path="/myAction" type="com.mycompany.MyAction" />

in struts-config.xml, the ActionForm passed to the execute() method in MyAction will be null since you didn't specify the "name" attribute to identify a form bean attached to this action.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is ActionForm is mandatory in writing Action class