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.
Answer Posted / 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 |
Post New Answer View All Answers
Do I have to credit struts on my own website?
What is the default suffix for Struts2 action URI and how can we change it?
What is the use of reset method of ActionForm class?
Can you explain struts.properties in struts2?
How do I access token?
What are the various struts tag libraries?
What are the core classes of the struts framework?
What are the two different types of validations that the validator framework supports?
What is action chaining ?
Which model components are supported by Struts?
What is the purpose of '@keyproperty'?
What is the purpose of @action annotation?
Explain about the future of struts?
What is struts-default package and what are it’s benefits?
What do you mean by the abstract package in struts2, and what is its utilization?