REVOLUTION TO NEXT GENERATION Struts2.0 20/02/2009 Avishek Arang :: avishekarang@gmail.com
Topics discussed … <ul><li>Basic features of struts2.0. </li></ul><ul><li>Struts2 vs struts1.1.  </li></ul><ul><li>Archite...
<ul><li>Page-based Navigation </li></ul><ul><li>Built-in Ajax Support: DWR and Dojo </li></ul><ul><li>Spring as default in...
<ul><li>Struts2.0 </li></ul><ul><li>Struts1.1 </li></ul><ul><li>Action </li></ul><ul><li>Action or POJO </li></ul><ul><li>...
Architecture 20/02/2009 Avishek Arang :: avishekarang@gmail.com
<ul><li>User Sends request. </li></ul><ul><li>FilterDispatcher determines the appropriate action. </li></ul><ul><li>Interc...
<ul><li>Select Tools > Plugins: </li></ul><ul><li>To configure struts plugins  to netbeans IDE. </li></ul>20/02/2009 Avish...
<ul><li>Configure Plugins: </li></ul><ul><li>org-netbeans-modules-web-frameworks-struts2.nbm </li></ul><ul><li>org-netbean...
<ul><li>Struts 2 Core components are Action handler, Result Handler and Custom Tags.  </li></ul><ul><li>Action handler Act...
<ul><li><struts>  </li></ul><ul><li><include file=&quot;struts-default.xml&quot;/>  </li></ul><ul><ul><li><constant name=&...
<ul><li>Used to modularize application. </li></ul><ul><li>Always a child of <struts> tag. </li></ul><ul><li>Only attribute...
<ul><li>name - unique. </li></ul><ul><li>extends - “struts-default”. </li></ul><ul><li>namespace- admin, knowledgecenter, ...
<ul><li>They provide a way to supply pre-processing and post-processing around the action. </li></ul><ul><li>examples incl...
<ul><li>Field Summary  </li></ul><ul><li>static  String   ERROR  The action execution was a failure.  </li></ul><ul><li>st...
<ul><li>- www.roseindia.com - Starting Struts2 by Ian Roughley [free ebook]. - Struts 2 Design and Programming: A Tutorial...
Upcoming SlideShare
Loading in …5
×

Struts2.0basic

2,823 views

Published on

re-uploading the ppt ...
-basics
-architecture
-vs Struts1.1

1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
2,823
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
95
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Struts2.0basic

  1. 1. REVOLUTION TO NEXT GENERATION Struts2.0 20/02/2009 Avishek Arang :: avishekarang@gmail.com
  2. 2. Topics discussed … <ul><li>Basic features of struts2.0. </li></ul><ul><li>Struts2 vs struts1.1. </li></ul><ul><li>Architecture of struts2.0. </li></ul><ul><li>Basic flow of struts2.0. </li></ul><ul><li>How to configure the plugins for struts2 in netbeans IDE. </li></ul><ul><li>Some basic components in brief. </li></ul><ul><li>Reference </li></ul>20/02/2009 Avishek Arang :: avishekarang@gmail.com
  3. 3. <ul><li>Page-based Navigation </li></ul><ul><li>Built-in Ajax Support: DWR and Dojo </li></ul><ul><li>Spring as default inversion of control container </li></ul><ul><li>Changed from front-controller servlet to filter </li></ul><ul><li>Much better client-side validation support </li></ul><ul><li>QuickStart and Annotations </li></ul><ul><li>JSF Support </li></ul><ul><li>Built-in support for testing with StrutsTestCase </li></ul>Features 20/02/2009 Avishek Arang :: avishekarang@gmail.com
  4. 4. <ul><li>Struts2.0 </li></ul><ul><li>Struts1.1 </li></ul><ul><li>Action </li></ul><ul><li>Action or POJO </li></ul><ul><li>Result </li></ul><ul><li>struts.xml </li></ul><ul><li>FilterDispatcher </li></ul><ul><li>Interceptors </li></ul><ul><li>Action-validation.xml </li></ul><ul><li>Action </li></ul><ul><li>ActionForm </li></ul><ul><li>ActionForward </li></ul><ul><li>struts-config.xml </li></ul><ul><li>ActionServlet </li></ul><ul><li>RequestProcessor </li></ul><ul><li>validation.xml </li></ul>Comparison 20/02/2009 Avishek Arang :: avishekarang@gmail.com
  5. 5. Architecture 20/02/2009 Avishek Arang :: avishekarang@gmail.com
  6. 6. <ul><li>User Sends request. </li></ul><ul><li>FilterDispatcher determines the appropriate action. </li></ul><ul><li>Interceptors are applied .   </li></ul><ul><li>Execution of Action .   </li></ul><ul><li>Output rendering .   </li></ul><ul><li>Return of Request( reverse order ) .   </li></ul><ul><li>Display the result to user . </li></ul>Flow of Struts 2 based Application Avishek Arang :: avishekarang@gmail.com 20/02/2009
  7. 7. <ul><li>Select Tools > Plugins: </li></ul><ul><li>To configure struts plugins to netbeans IDE. </li></ul>20/02/2009 Avishek Arang :: avishekarang@gmail.com
  8. 8. <ul><li>Configure Plugins: </li></ul><ul><li>org-netbeans-modules-web-frameworks-struts2.nbm </li></ul><ul><li>org-netbeans-modules-web-frameworks-struts2lib20011.nbm </li></ul>20/02/2009 Avishek Arang :: avishekarang@gmail.com
  9. 9. <ul><li>Struts 2 Core components are Action handler, Result Handler and Custom Tags.  </li></ul><ul><li>Action handler Action handler interacts with other layers. </li></ul><ul><li>Result Handler Result handler actually dispatches the request to view. </li></ul><ul><li>Custom Tags </li></ul><ul><li>Custom Tags are used render the dynamic content. </li></ul><ul><li>Interceptors The Interceptors are used to specify the &quot;request-processing lifecycle&quot; 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 </li></ul><ul><li>Expression Language(ONGL- Object Graph Notation Language) </li></ul>Struts 2 Core components Avishek Arang :: avishekarang@gmail.com 20/02/2009
  10. 10. <ul><li><struts> </li></ul><ul><li><include file=&quot;struts-default.xml&quot;/> </li></ul><ul><ul><li><constant name=&quot;struts.custom.i18n.resources&quot; value=&quot;MessageResources&quot; /> </li></ul></ul><ul><ul><li><package name=&quot;default&quot; extends=&quot;struts-default&quot;> </li></ul></ul><ul><ul><ul><li><action name=&quot;list&quot; class=&quot;web.DefectsList&quot;> </li></ul></ul></ul><ul><ul><ul><li><result>/pages/defects.jsp</result> </li></ul></ul></ul><ul><ul><ul><li></action> </li></ul></ul></ul><ul><ul><ul><li><action name=&quot;action_*&quot; method=&quot;{1}&quot; class=&quot;web.DefectsAction&quot;> </li></ul></ul></ul><ul><ul><ul><li><result name=&quot;input&quot;>/pages/editDefect.jsp</result> </li></ul></ul></ul><ul><ul><ul><li><result type=&quot;redirect&quot;>list.action</result> </li></ul></ul></ul><ul><ul><ul><li></action> </li></ul></ul></ul><ul><ul><li></package> </li></ul></ul><ul><li></struts> </li></ul>struts.xml Avishek Arang :: avishekarang@gmail.com 20/02/2009
  11. 11. <ul><li>Used to modularize application. </li></ul><ul><li>Always a child of <struts> tag. </li></ul><ul><li>Only attribute “file” implies the config file. </li></ul><ul><li><include file=“module1-config.xml”> </li></ul><ul><li>Order of including files are important. </li></ul><ul><li>explicitly include: “struts-default.xml” and the “struts-plugin.xml” files </li></ul><include> Avishek Arang :: avishekarang@gmail.com 20/02/2009
  12. 12. <ul><li>name - unique. </li></ul><ul><li>extends - “struts-default”. </li></ul><ul><li>namespace- admin, knowledgecenter, test. </li></ul><ul><li>Abstract-if “true” actions configured will not be accessible via the package name. </li></ul><package> Avishek Arang :: avishekarang@gmail.com 20/02/2009
  13. 13. <ul><li>They provide a way to supply pre-processing and post-processing around the action. </li></ul><ul><li>examples include exception handling, file uploading, lifecycle callbacks and validation. </li></ul><ul><li><interceptors> </li></ul><ul><li><interceptor name=&quot;autowiring“ class=&quot;interceptor.ActionAutowiringInterceptor&quot;/> </li></ul><ul><li></interceptors> </li></ul><ul><li><action name=&quot;my&quot; class=&quot;com.fdar.infoq.MyAction&quot; > </li></ul><ul><ul><li><result>view.jsp</result> </li></ul></ul><ul><ul><li><interceptor-ref name=&quot;autowiring&quot;/> </li></ul></ul><ul><ul><li></action> </li></ul></ul>Interceptor Avishek Arang :: avishekarang@gmail.com 20/02/2009
  14. 14. <ul><li>Field Summary </li></ul><ul><li>static  String ERROR The action execution was a failure. </li></ul><ul><li>static  String INPUT The action execution require more input in order to succeed. </li></ul><ul><li>static  String LOGIN           The action could not execute, since the user most was not logged in. </li></ul><ul><li>static  String NONE           The action execution was successful but do not show a view. </li></ul><ul><li>static  String SUCCESS           The action execution was successful.   </li></ul><ul><li>Method Summary   String execute ()           Where the logic of the action is executed. </li></ul>com.opensymphony.xwork2 Interface Action Avishek Arang :: avishekarang@gmail.com 20/02/2009
  15. 15. <ul><li>- www.roseindia.com - Starting Struts2 by Ian Roughley [free ebook]. - Struts 2 Design and Programming: A Tutorial by Budi Kurniawan. </li></ul>Bibliography Avishek Arang :: avishekarang@gmail.com 20/02/2009

×