SlideShare une entreprise Scribd logo
1  sur  45
 
Struts2  Reinventing Struts1 Wheel Ori Dar Consultant and Architect, AlphaCSP
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction::In a nutshell (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction::In a nutshell (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction::In a nutshell (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction::HelloWorld ,[object Object],< filter > < filter-name >action2</ filter-name > < filter-class >org.apache.struts2.dispatcher.FilterDispatcher</ filter-class > </ filter > < filter-mapping > < filter-name >action2</ filter-name > < url-pattern >/*</ url-pattern > </ filter-mapping > web.xml
Introduction::HelloWorld, Model public   class  HelloWorld { private  String  message = &quot;Hello World. Time is: &quot; ; public  String  execute () {  message  +=  new  Date();   return   &quot;success&quot; ; } public  String getMessage() { return  message ; } } action method returns  a result code We don’t have to extend Action Boss …  and no request, response in execute() Boss
Introduction::HelloWorld, View ,[object Object],[object Object],[object Object],< % @   taglib prefix=&quot;s&quot; uri=&quot;/struts-tags&quot;%> < html > < body > < s:property   value= “message“ /> </ body > </ html > Prints action’s message property. Unlike struts1,  action is a POJO, and acts as a model
Introduction::HelloWorld ,[object Object],[object Object],[object Object],< action   name= “hello“  class= &quot;com.alphacsp.actions.HelloWorld&quot; >  < result   name= “success“ >/pages/HelloWorld.jsp</ result >  </ action >   links action to view http://host:port/app/hello.action Use action name in URL invocation
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Background ::S2 Vs. S1 Configuration Lifecycle Validation EL View binding Form binding Threading Servlet API Action Role Action Wildcards, annotations Independent via interceptors xml or annotations OGNL Value Stack Action JavaBean properties Instance per request Decoupled Model POJO (with execute) Struts2 Verbose Shared Action Form JSTL EL JSP mechanisms Action Form Single instance Dependant Controller Extends Action Struts1
Background ::Interceptors ,[object Object],[object Object],[object Object],[object Object],[object Object],< action   name= &quot;phoneBook&quot;   class= &quot;com.alphacsp.actions.PhoneBook&quot; > < interceptor-ref   name= &quot;acspStack&quot; /> < result >/pages/phoneBook.jsp</ result > </ action >  struts.xml
Background ::Interceptors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Excerpt from struts-default.xml interceptor interceptor stack contains other interceptors  the default stack for actions in package  struts-default.xml
Background ::V alueStack  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Background ::OGNL   ,[object Object],[object Object],< s:textfield   name= &quot;contact.email&quot; />  < s:text   name= &quot;email&quot; />  phoneBook.jsp phoneBook.jsp retrieves email property of actions’ contact property from stack using OGNL retrieves localized message using email as key from stack using OGNL
Background :: Other features ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Background ::  Theme example < s:form   action= &quot;login&quot;   namespace= &quot;/&quot;  validate= &quot;true&quot; > < s:textfield   cssClass= &quot;loginField&quot;   size= &quot;25&quot;   key= &quot;username&quot; /> < s:password   cssClass= &quot;loginField&quot;   size= &quot;25&quot;   key= &quot;password&quot; /> < s:submit   value= &quot;Login&quot;   cssClass= &quot;button&quot;   align= &quot;center&quot; /> </ s:form > Xhtml theme generates  table and validation feedback. No themes in Struts1 login.jsp
Background :: Other features ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Features ::Action Configuration < action   name= &quot;listEmployees&quot;   class= &quot;actions.model.Employee&quot;  method= &quot;list&quot; > < result   name= &quot;list&quot;  type= &quot;dispatcher&quot; >/WEB-INF/list.jsp</ result > </ action > result type the view technology (default value: “dispatcher” for rendering JSP) result name action method should return a matching result code string (default value: “success”) action method within action class (default value: “execute”) action class action name  matched by a URL
Features :: Action Configuration ,[object Object],[object Object],[object Object],< action   name= &quot;list*s&quot;   class= &quot;actions.model.{1}&quot;   method= &quot;list&quot; > < result  name= &quot;list&quot; > /WEB-INF/list{1}s.jsp </ result > </ action > listEmployees.action is mapped to Employee class and listEmployees.jsp listDepartments.action is mapped to Department class and listDepartmrnts.jsp …
Features ::Annotation Config. ,[object Object],[object Object],[object Object],[object Object],@Result ( name= &quot;list&quot; , value= &quot;/WEB-INF/list.jsp&quot; ) public   class  Employee  extends  ActionSupport { public  String listEmployees() { //  business logic goes here return   &quot;list&quot; ; } } “ list” result code is mapped to JSP. By extending ActionSupport, Employee is mapped  as action by the  package scanning mechanism
Features :: View technology ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Features ::Page flow 1 3 4 5 6 7 8 2
Features ::Page flow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Features :: Form binding < s:form   action= &quot;login&quot;   validate= &quot;true&quot;   namespace= &quot;/&quot; > < s:textfield   cssClass= &quot;loginField&quot;   key= &quot;username&quot; /> < s:submit   key= &quot;login&quot;   cssClass= &quot;button&quot;   align= &quot;center&quot; /> </ s:form > login.jsp public   class  Login { private  String  username; public   void  setUsername(String username) { this . username  = username; } } Login.java Form field parameters  are injected into setter  methods by the params  interceptor
Features ::Table sorting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Features ::Table sorting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],From demo application phoneBook.jsp
Features :: Pagination ,[object Object],[object Object],[object Object],[object Object]
Features ::Validation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Features ::Validation ,[object Object],[object Object],@EmailValidator( fieldName =  &quot;email&quot; ,  key= &quot;wrongEmailFormat&quot; ,  message= &quot;Wrong Email Format&quot; ) public   void  setEmail(String email) { this . email  = email; } PhoneBook.java < validators> < field   name= &quot;email&quot; >  < field-validator   type= &quot;email&quot; >  < message   key= &quot;wrongEmailFormat&quot; >  Wrong   Email   Format  </ message >  </ field-validator >  </ field > </ validators> PhoneBook_validation.xml
Features ::Client side validation ,[object Object],[object Object],[object Object],< s:actionerror   cssClass= &quot;feedback&quot; /> < s:form   action= &quot;login&quot;   namespace= &quot;/&quot;  validate= &quot;true&quot;   > < s:textfield   cssClass= &quot;loginField&quot;   size= &quot;25&quot;   key= &quot;username&quot; /> < s:password   cssClass= &quot;loginField&quot;   size= &quot;25&quot;   key= &quot;password&quot; /> < s:submit   value= &quot;Login&quot;   cssClass= &quot;button&quot;   align= &quot;center&quot; /> </ s:form > login.jsp
Features ::Ajax ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Features :: Ajax autocompleter ,[object Object],Action < s:url   id= &quot;acUrl&quot;   action= &quot;getDepts&quot; /> < s:autocompleter   name= &quot;dept&quot;   href= &quot;%{acUrl}&quot;   cssClass= &quot;acSearchField&quot; /> private  List<String>   deptList; public  String execute() { deptList =  service. findAllDepartments(); return  ActionSupport. SUCCESS; } public  List<String> getDeptList() { return   deptList; } phoneBook.jsp PhoneBook.java < action   name= &quot;getDepts&quot;   class= &quot;DeptsAutoComplete&quot; >  < result   type= &quot;json&quot; >  < param   name= &quot;root&quot; > deptList </ param >  </ result >  </ action >  struts-default.xml
Features ::Error handling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Features ::Error handling ,[object Object],[object Object],[object Object],<!-- Fallback error page: --> < global-results > < result   name= &quot;sysError&quot; >/pages/systemError.jsp</ result > </ global-results > < global-exception-mappings > < exception-mapping   exception= &quot;java.lang.Exception&quot;   result= &quot;sysError&quot; /> </ global-exception-mappings > struts.xml
Features ::I18N support ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Features ::Documentation ,[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary::Pros ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary::Pros ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary::Cons ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary::When to use ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]

Contenu connexe

Tendances

Struts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsStruts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsJavaEE Trainers
 
Session 38 - Core Java (New Features) - Part 1
Session 38 - Core Java (New Features) - Part 1Session 38 - Core Java (New Features) - Part 1
Session 38 - Core Java (New Features) - Part 1PawanMM
 
Session 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPSession 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPPawanMM
 
How to test models using php unit testing framework?
How to test models using php unit testing framework?How to test models using php unit testing framework?
How to test models using php unit testing framework?satejsahu
 
Django Patterns - Pycon India 2014
Django Patterns - Pycon India 2014Django Patterns - Pycon India 2014
Django Patterns - Pycon India 2014arunvr
 
Java interview-questions-and-answers
Java interview-questions-and-answersJava interview-questions-and-answers
Java interview-questions-and-answersbestonlinetrainers
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsSrikanth Shenoy
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applicationselliando dias
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsRan Mizrahi
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazy Koder
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQueryKnoldus Inc.
 
ASP.NET Routing & MVC
ASP.NET Routing & MVCASP.NET Routing & MVC
ASP.NET Routing & MVCEmad Alashi
 
Command Design Pattern
Command Design Pattern Command Design Pattern
Command Design Pattern anil kanzariya
 
Headless fragments in Android
Headless fragments in AndroidHeadless fragments in Android
Headless fragments in AndroidAli Muzaffar
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design PatternShahriar Hyder
 
Sencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScriptSencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScriptRohan Chandane
 
Template method pattern example
Template method pattern exampleTemplate method pattern example
Template method pattern exampleGuo Albert
 

Tendances (20)

Struts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsStruts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web Applications
 
Session 38 - Core Java (New Features) - Part 1
Session 38 - Core Java (New Features) - Part 1Session 38 - Core Java (New Features) - Part 1
Session 38 - Core Java (New Features) - Part 1
 
Session 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPSession 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOP
 
How to test models using php unit testing framework?
How to test models using php unit testing framework?How to test models using php unit testing framework?
How to test models using php unit testing framework?
 
Django Patterns - Pycon India 2014
Django Patterns - Pycon India 2014Django Patterns - Pycon India 2014
Django Patterns - Pycon India 2014
 
Java interview-questions-and-answers
Java interview-questions-and-answersJava interview-questions-and-answers
Java interview-questions-and-answers
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
 
Spring annotation
Spring annotationSpring annotation
Spring annotation
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applications
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design Patterns
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptors
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
 
ASP.NET Routing & MVC
ASP.NET Routing & MVCASP.NET Routing & MVC
ASP.NET Routing & MVC
 
Functions in javascript
Functions in javascriptFunctions in javascript
Functions in javascript
 
Command Design Pattern
Command Design Pattern Command Design Pattern
Command Design Pattern
 
Headless fragments in Android
Headless fragments in AndroidHeadless fragments in Android
Headless fragments in Android
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design Pattern
 
TY.BSc.IT Java QB U1
TY.BSc.IT Java QB U1TY.BSc.IT Java QB U1
TY.BSc.IT Java QB U1
 
Sencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScriptSencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScript
 
Template method pattern example
Template method pattern exampleTemplate method pattern example
Template method pattern example
 

Similaire à Struts2 Framework Overview

[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
Krazykoder struts2 plugins
Krazykoder struts2 pluginsKrazykoder struts2 plugins
Krazykoder struts2 pluginsKrazy Koder
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSCarol McDonald
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
Liferay Training Struts Portlet
Liferay Training Struts PortletLiferay Training Struts Portlet
Liferay Training Struts PortletSaikrishna Basetti
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 
Component and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHPComponent and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHPStephan Schmidt
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsJohannes Geppert
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop NotesPamela Fox
 
Struts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configurationStruts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configurationJavaEE Trainers
 
JSP diana y yo
JSP diana y yoJSP diana y yo
JSP diana y yomichael
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing frameworkIndicThreads
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLseleciii44
 

Similaire à Struts2 Framework Overview (20)

Struts2
Struts2Struts2
Struts2
 
Retrofitting
RetrofittingRetrofitting
Retrofitting
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Krazykoder struts2 plugins
Krazykoder struts2 pluginsKrazykoder struts2 plugins
Krazykoder struts2 plugins
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Liferay Training Struts Portlet
Liferay Training Struts PortletLiferay Training Struts Portlet
Liferay Training Struts Portlet
 
DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Alfresco Search Internals
Alfresco Search InternalsAlfresco Search Internals
Alfresco Search Internals
 
Component and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHPComponent and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHP
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid Tags
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
 
Struts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configurationStruts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configuration
 
Ajax ons2
Ajax ons2Ajax ons2
Ajax ons2
 
JSP diana y yo
JSP diana y yoJSP diana y yo
JSP diana y yo
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing framework
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTL
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 

Dernier

BEST ✨ Call Girls In Indirapuram Ghaziabad ✔️ 9871031762 ✔️ Escorts Service...
BEST ✨ Call Girls In  Indirapuram Ghaziabad  ✔️ 9871031762 ✔️ Escorts Service...BEST ✨ Call Girls In  Indirapuram Ghaziabad  ✔️ 9871031762 ✔️ Escorts Service...
BEST ✨ Call Girls In Indirapuram Ghaziabad ✔️ 9871031762 ✔️ Escorts Service...noida100girls
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
 
Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdfOrient Homes
 
Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessAggregage
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear RegressionRavindra Nath Shukla
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Vip Dewas Call Girls #9907093804 Contact Number Escorts Service Dewas
Vip Dewas Call Girls #9907093804 Contact Number Escorts Service DewasVip Dewas Call Girls #9907093804 Contact Number Escorts Service Dewas
Vip Dewas Call Girls #9907093804 Contact Number Escorts Service Dewasmakika9823
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in managementchhavia330
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...lizamodels9
 
Catalogue ONG NƯỚC uPVC - HDPE DE NHAT.pdf
Catalogue ONG NƯỚC uPVC - HDPE DE NHAT.pdfCatalogue ONG NƯỚC uPVC - HDPE DE NHAT.pdf
Catalogue ONG NƯỚC uPVC - HDPE DE NHAT.pdfOrient Homes
 
Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.Eni
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfPaul Menig
 
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetCreating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetDenis Gagné
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyEthan lee
 

Dernier (20)

BEST ✨ Call Girls In Indirapuram Ghaziabad ✔️ 9871031762 ✔️ Escorts Service...
BEST ✨ Call Girls In  Indirapuram Ghaziabad  ✔️ 9871031762 ✔️ Escorts Service...BEST ✨ Call Girls In  Indirapuram Ghaziabad  ✔️ 9871031762 ✔️ Escorts Service...
BEST ✨ Call Girls In Indirapuram Ghaziabad ✔️ 9871031762 ✔️ Escorts Service...
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
Best Practices for Implementing an External Recruiting Partnership
Best Practices for Implementing an External Recruiting PartnershipBest Practices for Implementing an External Recruiting Partnership
Best Practices for Implementing an External Recruiting Partnership
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
 
Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdf
 
Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for Success
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear Regression
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Vip Dewas Call Girls #9907093804 Contact Number Escorts Service Dewas
Vip Dewas Call Girls #9907093804 Contact Number Escorts Service DewasVip Dewas Call Girls #9907093804 Contact Number Escorts Service Dewas
Vip Dewas Call Girls #9907093804 Contact Number Escorts Service Dewas
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in management
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
Catalogue ONG NƯỚC uPVC - HDPE DE NHAT.pdf
Catalogue ONG NƯỚC uPVC - HDPE DE NHAT.pdfCatalogue ONG NƯỚC uPVC - HDPE DE NHAT.pdf
Catalogue ONG NƯỚC uPVC - HDPE DE NHAT.pdf
 
Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
 
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetCreating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
 

Struts2 Framework Overview

  • 1.  
  • 2. Struts2 Reinventing Struts1 Wheel Ori Dar Consultant and Architect, AlphaCSP
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Introduction::HelloWorld, Model public class HelloWorld { private String message = &quot;Hello World. Time is: &quot; ; public String execute () { message += new Date(); return &quot;success&quot; ; } public String getMessage() { return message ; } } action method returns a result code We don’t have to extend Action Boss … and no request, response in execute() Boss
  • 9.
  • 10.
  • 11.
  • 12. Background ::S2 Vs. S1 Configuration Lifecycle Validation EL View binding Form binding Threading Servlet API Action Role Action Wildcards, annotations Independent via interceptors xml or annotations OGNL Value Stack Action JavaBean properties Instance per request Decoupled Model POJO (with execute) Struts2 Verbose Shared Action Form JSTL EL JSP mechanisms Action Form Single instance Dependant Controller Extends Action Struts1
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. Background :: Theme example < s:form action= &quot;login&quot; namespace= &quot;/&quot; validate= &quot;true&quot; > < s:textfield cssClass= &quot;loginField&quot; size= &quot;25&quot; key= &quot;username&quot; /> < s:password cssClass= &quot;loginField&quot; size= &quot;25&quot; key= &quot;password&quot; /> < s:submit value= &quot;Login&quot; cssClass= &quot;button&quot; align= &quot;center&quot; /> </ s:form > Xhtml theme generates table and validation feedback. No themes in Struts1 login.jsp
  • 19.
  • 20.
  • 21. Features ::Action Configuration < action name= &quot;listEmployees&quot; class= &quot;actions.model.Employee&quot; method= &quot;list&quot; > < result name= &quot;list&quot; type= &quot;dispatcher&quot; >/WEB-INF/list.jsp</ result > </ action > result type the view technology (default value: “dispatcher” for rendering JSP) result name action method should return a matching result code string (default value: “success”) action method within action class (default value: “execute”) action class action name matched by a URL
  • 22.
  • 23.
  • 24.
  • 25. Features ::Page flow 1 3 4 5 6 7 8 2
  • 26.
  • 27. Features :: Form binding < s:form action= &quot;login&quot; validate= &quot;true&quot; namespace= &quot;/&quot; > < s:textfield cssClass= &quot;loginField&quot; key= &quot;username&quot; /> < s:submit key= &quot;login&quot; cssClass= &quot;button&quot; align= &quot;center&quot; /> </ s:form > login.jsp public class Login { private String username; public void setUsername(String username) { this . username = username; } } Login.java Form field parameters are injected into setter methods by the params interceptor
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.