Академический Документы
Профессиональный Документы
Культура Документы
0
1 REVOLUTION TO NEXT GENERATION
20/02/2009
Topics discussed
Basic features of struts2.0. Struts2 vs struts1.1. Architecture of struts2.0. Basic flow of struts2.0. How to configure the plugins for
20/02/2009
Features
3
P a g e - b a s e d N a v i g a t i o n B u i l t - i n A j a x S u p p o r t : D W R a n d D o j o S p r i n g a s d e f a u l t i n v e r s i o n o f c o n t r o l c o n t a i n e r C h a n g e d f r o m f r o n t - c o n t r o l l e r s e r v l e t t o f i l t e r M u c h b e t t e r c l i e n t - s i d e v a l i d a t i o n s u p p o r t Q u i c k S t a r t a n d A n n o t a t i o n s J S F S u p p o r t B u i l t - i n s u p p o r t f o r t e s t i n g w i t h S t r u t s T e s t C a s e
20/02/2009
Comparison
4
Struts2.0
Struts1.1
Architecture
5
20/02/2009
U s e r S e n d s r e q u e s t . F i l t e r D i s p a t c h e r d e t e r m i n e s t h e a p p r o p r i a t e
action. I n t e r c e p t o r s a r e a p p l i e d . E x e c u t i o n o f A c t i o n . O u t p u t r e n d e r i n g . R e t u r n o f R e q u e s t ( r e v e r s e o r d e r ) . D i s p l a y t h e r e s u l t t o u s e r .
20/02/2009
20/02/2009
20/02/2009
and Custom Tags. A c t i o n h a n d l e r Action handler interacts with other layers. R e s u l t H a n d l e r Result handler actually dispatches the request to view. C u s t o m T a g s Custom Tags are used render the dynamic content. I n t e r c e p t o r s The Interceptors are used to specify the "request -processing lifecycle" for an action. Interceptors are configured to apply the common functionalities like workflow, validation etc.. to the request. Interceptors code is executed before and after an Action is invoked E x p r e s s i o n L a n g u a g e ( O N G L - O b j e c t G r a p h N o t a t i o n L a n g u a g e )
20/02/2009
struts.xml
10
<struts> <include file="struts-default.xml"/> <constant name="struts.custom.i18n.resources" value="MessageResources" /> <package name="default" extends="struts-default"> <action name="list" class="web.DefectsList"> <result>/pages/defects.jsp</result> </action> <action name="action_*" method="{1}" class="web.DefectsAction"> <result name="input">/pages/editDefect.jsp</result> <result type="redirect">list.action</result> </action> </package> </struts>
20/02/2009
<include>
11
struts-plugin.xml files
20/02/2009
<package>
12
n a m e - u n i q u e . e x t e n d s - s t r u t s - d e f a u l t . n a m e s p a c e - a d m i n , k n o w l e d g e c e n t e r , t e s t . A b s t r a c t - i f t r u e a c t i o n s c o n f i g u r e d w i l l n o t b e
20/02/2009
Interceptor
13
T h e y p r o v i d e a w a y t o s u p p l y p r e - p r o c e s s i n g a n d p o s t - p r o c e s s i n g
<interceptors> <interceptor name="autowiring class="interceptor.ActionAutowiringInterceptor "/> </interceptors> <action name="my" class="com.fdar.infoq.MyAction" > <result>view.jsp</result> <interceptor-ref name="autowiring"/> </action>
Avishek Arang :: avishekarang@gmail.com
20/02/2009
in order to succeed. s t a t i c S t r i n g L O G I N The action could not execute, since the user most was not logged in. s t a t i c S t r i n g N O N E The action execution was successful but do not show a view. s t a t i c S t r i n g S U C C E S S The action execution was successful. M e t h o d S u m m a r y S t r i n g e x e c u t e ( ) Where the logic of the action is executed.
20/02/2009
Bibliography
15 - www.roseindia.com - Starting Struts2 by Ian Roughley [free ebook]. - Struts 2 Design and Programming: A Tutorial by Budi Kurniawan.
20/02/2009