In ActionClass we can use only one action i.e execute(), but
in DispatchAction we can use multiple actions.My question is
, we can use multiple actions in Action class
if(action.equals("add") if(action.equals("update"). Then
when to use Action and DispatchAction which is frequently
in webapplications.




Answers were Sorted based on User's Feedback



In ActionClass we can use only one action i.e execute(), but in DispatchAction we can use multiple ..

Answer / shirish

DispatchAction is generally used when we need to group a set
of actions. E.g. addDepartment, editDepartment,
updateDepartment, deleteDepartment. The method to be called
is identified on the basis of a parameter which can be
configured in struts-config.com (action tag). The parameter
is usually passed from the JSP and is automatically mapped
to the action parameter (defined in action tag in
struts-config.xml). Also we need to add an attribute with
name same as the parameter name to the corresponding ActionForm

Is This Answer Correct ?    6 Yes 1 No

In ActionClass we can use only one action i.e execute(), but in DispatchAction we can use multiple ..

Answer / sekhar babu

If multiple actions refer to the same formbean then we
should go for DispatchAction. Yes as you said it is possible
to write in Action. But by using dispatchAction we can
simply specify the parameter name in config file.

No need to write the code in our appln

Is This Answer Correct ?    3 Yes 0 No

Post New Answer




More Struts Interview Questions

What is difference between interceptors and filters?

0 Answers  


How is forward action used for integration?

0 Answers  


What does execandwait interceptor?

0 Answers  


Explain the life cycle of a request in struct2 application?

0 Answers  


Is form beans are serializable or not?

11 Answers   Magna Infotech, College School Exams Tests,






struts 1.3 features?

1 Answers   Integra, Zensar,


What is the purpose of struts.xml in struct2?

0 Answers  


What is the purpose of @conversion annotation annotation?

0 Answers  


i have a log in web application .... i want restrict the user for particular no of users what is procedure to develop thus application

2 Answers  


How properties of a form are validated in Struts?

0 Answers  


What is the default suffix for struts2 action uri ?

0 Answers  


What is struts validator framework?

0 Answers  






Categories