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 the purpose of @key annotation annotation?

0 Answers  


What is actionform in struts?

0 Answers  


What’s the utilization of resource bundle properties file in struts validation structure?

0 Answers  


Can you give an overview of how a struts application flows?

0 Answers  


How to add ms-word file in struts at the same time how to add images

1 Answers  






Name some useful annotations introduced in Struts2?

0 Answers  


What is the DynaActionForm? How we implement the dynaactionform ? can u please tell me the way to implement? in understandable way?

8 Answers   JBA Infotech,


In struts how to use regurlar formbeans using validation framework explain?

1 Answers   TCS,


How do I access token?

0 Answers  


Why is it called struts?

0 Answers  


What happens when Two users requests for same action class? How the threads are controlled?

4 Answers  


Define struts?

0 Answers  


Categories