Download presentation
Presentation is loading. Please wait.
Published byDarren Eugene Thornton Modified over 9 years ago
1
REVOLUTION TO NEXT GENERATION Struts2.0 20/02/2009 1 Avishek Arang :: avishekarang@gmail.com
2
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 struts2 in netbeans IDE. Some basic components in brief. Reference 20/02/2009 2 Avishek Arang :: avishekarang@gmail.com
3
Page-based Navigation Built-in Ajax Support: DWR and Dojo Spring as default inversion of control container Changed from front-controller servlet to filter Much better client-side validation support QuickStart and Annotations JSF Support Built-in support for testing with StrutsTestCase Features 20/02/2009 3 Avishek Arang :: avishekarang@gmail.com
4
Struts2.0 Struts1.1 Action Action or POJO Result struts.xml FilterDispatcher Interceptors Action-validation.xml Action ActionForm ActionForward struts-config.xml ActionServlet RequestProcessor validation.xml Comparison 20/02/2009 4 Avishek Arang :: avishekarang@gmail.com
5
Architecture 20/02/2009 Avishek Arang :: avishekarang@gmail.com 5
6
User Sends request. FilterDispatcher determines the appropriate action. Interceptors are applied. Execution of Action. Output rendering. Return of Request(reverse order). Display the result to user. Avishek Arang :: avishekarang@gmail.com 20/02/2009 6 Flow of Struts 2 based Application
7
Select Tools > Plugins: To configure struts plugins to netbeans IDE. 20/02/2009 7 Avishek Arang :: avishekarang@gmail.com
8
Configure Plugins: org-netbeans-modules- web-frameworks- struts2.nbm org-netbeans-modules- web-frameworks- struts2lib20011.nbm 20/02/2009 8 Avishek Arang :: avishekarang@gmail.com
9
Struts 2 Core components are Action handler, Result Handler and Custom Tags. Action handler Action handler interacts with other layers. Result Handler Result handler actually dispatches the request to view. Custom Tags Custom Tags are used render the dynamic content. Interceptors 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 Expression Language(ONGL- Object Graph Notation Language) Avishek Arang :: avishekarang@gmail.com 20/02/2009 9 Struts 2 Core components
10
/pages/defects.jsp /pages/editDefect.jsp list.action Avishek Arang :: avishekarang@gmail.com 20/02/2009 10 struts.xml
11
Used to modularize application. Always a child of tag. Only attribute “file” implies the config file. Order of including files are important. explicitly include: “struts-default.xml” and the “struts-plugin.xml” files Avishek Arang :: avishekarang@gmail.com 20/02/2009 11
12
name - unique. extends - “struts-default”. namespace- admin, knowledgecenter, test. Abstract-if “true” actions configured will not be accessible via the package name. Avishek Arang :: avishekarang@gmail.com 20/02/2009 12
13
They provide a way to supply pre-processing and post-processing around the action. examples include exception handling, file uploading, lifecycle callbacks and validation. view.jsp Avishek Arang :: avishekarang@gmail.com 20/02/2009 13 Interceptor
14
Field Summary static String ERROR The action execution was a failure.StringERROR static String INPUT The action execution require more input in order to succeed.StringINPUT static String LOGIN The action could not execute, since the user most was not logged in.StringLOGIN static String NONE The action execution was successful but do not show a view.StringNONE static String SUCCESS The action execution was successful. StringSUCCESS Method Summary String execute() Where the logic of the action is executed.Stringexecute Avishek Arang :: avishekarang@gmail.com 20/02/2009 14 com.opensymphony.xwork2 Interface Action
15
- www.roseindia.com - Starting Struts2 by Ian Roughley [free ebook]. - Struts 2 Design and Programming: A Tutorial by Budi Kurniawan. Avishek Arang :: avishekarang@gmail.com 20/02/2009 15 Bibliography
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.