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
What is actionmapping?
What is the purpose of @createifnull annotation annotation?
What are the struts2 configuration properties that control file uploading process?
What inbuilt themes are provided by struts2?
How duplicate form submission can be controlled in struts?
What is DynaActionForm?
What are the aware interfaces in struts2?
How many servlet controllers are used in a Struts Application?
Explain the difference between jakarta struts and apache struts?
What does execandwait interceptor?
Which interceptor is responsible for i18n support?
What are the sections into which a strut configuration file can be divided?
What does validation interceptor?
What is the purpose of struct-config.xml in struct2?
Why we use struts in java?