struts_02
DESCRIPTION
stTRANSCRIPT
There are six action classes: ----------- Action DispatchAction LookupDispatchAction IncludeAction ForwardAction SwitchActionIn struts 1.2 the followin three actions are added: -------- !appinDispatchAction LocaleAction DownloadAction Action class is a"aila#le in or.apache.struts.action packae $hen %ou extends action class %ou need to o"erwrite execute&' (ethod with followin four para(eters :---------1' Action!appin2' ActionFor()' *ttpSer"let+e,uest-' *ttpSer"let+esponse For the entire application onl% one instance will #e created for the Action class and the sa(e instance will #e accessed #% (ultiple threads concurrentl% #ecause of this we should not declare an% instance "aria#le inside the Action class which is oin to store .lient specific data. $hen %ou use action class as super class we need to write (ultiple /a"a class for (ultiple re,uire(ents. In struts 1.0 Action class has perfor(&' (ethod instead of execute&' (ethod 1with the followin sinature :--------2u#lic ActionForward perfor(&A!1AF1*.S.+1*.S.+'throws Ser"let3xception1 I43xception5---- ---- ---- ---- ----6It was deprecated in struts 1.1 #ecause of followin reasons : --------- 2erfor(&' (ethod is throwin Ser"let3xception1 I43xception 1 when %ou are o"erridin that in su# class %ou can throw onl% S.3 and I43 and its su# classes. It should not throw an% other new 3xception whereas in the case of execute&' (ethod we can throw an% kind of exception #ecause its (ethod le"el exception is /a"a.lan.3xception. It is a"aila#le in or.apache.struts.action packaePatni ConfidentialTypes of actions in strutsActionNOTE: ---- when %ou ha"e (ultiple Action classes inside the application1 (ultiple instances will #e created on the #asis of one instance for the one class.DispatchAction DispatchAction pro"ides the facilit% to roup the si(ilar functionalit% into sinle /a"a class instead of writin (ultiple /a"a classes for (ultiple re,uire(ents.Usage: ---------In JSP7ht(l:for( action89:search.do ; hello8search9