Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is actionmapping?

1070


What is the purpose of @createifnull annotation annotation?

1028


What are the struts2 configuration properties that control file uploading process?

1123


What inbuilt themes are provided by struts2?

1102


How duplicate form submission can be controlled in struts?

1109


What is DynaActionForm?

1029


What are the aware interfaces in struts2?

1004


How many servlet controllers are used in a Struts Application?

1118


Explain the difference between jakarta struts and apache struts?

935


What does execandwait interceptor?

1020


Which interceptor is responsible for i18n support?

930


What are the sections into which a strut configuration file can be divided?

1044


What does validation interceptor?

986


What is the purpose of struct-config.xml in struct2?

971


Why we use struts in java?

917