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

which MVC architecture struts follows and why?

6 Answers   IBM,


How to create validations?what are struts validation components?

2 Answers  


What is difference between perform() used in struts1.0 and execute() used in 1.1 ?

3 Answers   Infotech,


why do we typecast ActionForm into out plain java bean class in Action class?

5 Answers  


How display data base errors on web console by using the Struts Framework?

2 Answers  






project architechture in java

3 Answers   INDUS, Satyam, IBM, AC,


how to implement singletun design patteren in struts?

5 Answers   HCL,


struts is thread safe or not ?give me answer as early as possible

5 Answers  


Hi Friends, why struts introduced in to web application. Plz dont send any links . Need main reason for implementing struts. Thanks Prakash

4 Answers  


what is project architecture?give brief explanation about project architecture?

3 Answers   Etisalat, IBM, CTS, Mphasis, Infinite Computer Solutions,


What is meant by portals???

9 Answers  


what are the actions in struts?

10 Answers   Wipro, Nihilent,






Categories