SlideShare ist ein Scribd-Unternehmen logo
1 von 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]

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsApsara Of India
 
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
 
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
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth MarketingShawn Pang
 
Socio-economic-Impact-of-business-consumers-suppliers-and.pptx
Socio-economic-Impact-of-business-consumers-suppliers-and.pptxSocio-economic-Impact-of-business-consumers-suppliers-and.pptx
Socio-economic-Impact-of-business-consumers-suppliers-and.pptxtrishalcan8
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 
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
 
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Tina Ji
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024christinemoorman
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒anilsa9823
 
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
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
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
 
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
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMANIlamathiKannappan
 
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é
 
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
 
DEPED Work From Home WORKWEEK-PLAN.docx
DEPED Work From Home  WORKWEEK-PLAN.docxDEPED Work From Home  WORKWEEK-PLAN.docx
DEPED Work From Home WORKWEEK-PLAN.docxRodelinaLaud
 
RE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman LeechRE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman LeechNewman George Leech
 

Kürzlich hochgeladen (20)

Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
 
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...
 
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.
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
 
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
 
Socio-economic-Impact-of-business-consumers-suppliers-and.pptx
Socio-economic-Impact-of-business-consumers-suppliers-and.pptxSocio-economic-Impact-of-business-consumers-suppliers-and.pptx
Socio-economic-Impact-of-business-consumers-suppliers-and.pptx
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
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
 
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
 
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
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
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
 
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
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
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
 
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
 
DEPED Work From Home WORKWEEK-PLAN.docx
DEPED Work From Home  WORKWEEK-PLAN.docxDEPED Work From Home  WORKWEEK-PLAN.docx
DEPED Work From Home WORKWEEK-PLAN.docx
 
RE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman LeechRE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman Leech
 

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.