Can we make Action class,DAOclass without Formclass

Showing Answers 1 - 6 of 6 Answers

abdul khalik

  • May 11th, 2006
 

We can make Action class with out form class and DAO class as well provided no form property is being used in action.  

cpublic class A extendes Action{

public ActionForward execute(.......){

// no actionform required unless you want to access form property

return ActionMapping.findForward(String);

}

abhipsa

  • Oct 6th, 2006
 

hi, frend.

i am getting confused by this answer.

According my point of view there is a concept of Dyanaction class where we there is no concept of form class.

Please let me knw iam getting stuck..

bye

  Was this answer useful?  Yes

Sanju

  • May 2nd, 2007
 

Dont get confused

1. In case of form, you got two options:

          a. Write an actual class with getter & setter method extending ActionForm

          b. Specify an virtual class DynaActionForm in struts-config with member variables specified. Means you dont create class by your own, struts does it for you.

          Brief: Suppose you got 10 pages, where each page contains just a single text field, then either you can create 10 ActionForm classes or you can just specify it in struts-config. Open your eyes and you can see clearly number of ActionForm just got reduced......

2. In case of action, you got only one option
 
         a. Create class which 'extends Action' or which 'extends classess that inturn extend Action' and return an ActionForward

          

  Was this answer useful?  Yes

Yes.
We can make Action class, DAO class without form class.
In this case, we can get the form elements by using HttpServletRequest.getParameter("elementName");

Mahes

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions