SlideShare a Scribd company logo
 
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]

More Related Content

What's hot

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
JavaEE 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 1
PawanMM
 
Session 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPSession 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOP
PawanMM
 
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 2014
arunvr
 
Java interview-questions-and-answers
Java interview-questions-and-answersJava interview-questions-and-answers
Java interview-questions-and-answers
bestonlinetrainers
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
Srikanth 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 Patterns
Ran 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 JQuery
Knoldus Inc.
 
ASP.NET Routing & MVC
ASP.NET Routing & MVCASP.NET Routing & MVC
ASP.NET Routing & MVC
Emad Alashi
 
Functions in javascript
Functions in javascriptFunctions in javascript
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 Android
Ali Muzaffar
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design Pattern
Shahriar Hyder
 
TY.BSc.IT Java QB U1
TY.BSc.IT Java QB U1TY.BSc.IT Java QB U1
TY.BSc.IT Java QB U1
Lokesh Singrol
 
Sencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScriptSencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScript
Rohan Chandane
 
Template method pattern example
Template method pattern exampleTemplate method pattern example
Template method pattern exampleGuo Albert
 

What's hot (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
 

Similar to Struts2

Struts2
Struts2Struts2
Retrofitting
RetrofittingRetrofitting
Retrofitting
Ted Husted
 
[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-WS
Carol McDonald
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
Ignacio Coloma
 
Liferay Training Struts Portlet
Liferay Training Struts PortletLiferay Training Struts Portlet
Liferay Training Struts PortletSaikrishna Basetti
 
DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8
Konstantinos Pantos
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
ipolevoy
 
Alfresco Search Internals
Alfresco Search InternalsAlfresco Search Internals
Alfresco Search Internals
Alfresco Software
 
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
Stephan Schmidt
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid Tags
Johannes Geppert
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
Pamela 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 configuration
JavaEE Trainers
 
Ajax ons2
Ajax ons2Ajax ons2
Ajax ons2
Chad Davis
 
JSP diana y yo
JSP diana y yoJSP diana y yo
JSP diana y yo
michael
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing framework
IndicThreads
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTL
seleciii44
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
Alfresco Software
 

Similar to Struts2 (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
 

Recently uploaded

CADAVER AS OUR FIRST TEACHER anatomt in your.pptx
CADAVER AS OUR FIRST TEACHER anatomt in your.pptxCADAVER AS OUR FIRST TEACHER anatomt in your.pptx
CADAVER AS OUR FIRST TEACHER anatomt in your.pptx
fakeloginn69
 
Memorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.pptMemorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.ppt
seri bangash
 
What is the TDS Return Filing Due Date for FY 2024-25.pdf
What is the TDS Return Filing Due Date for FY 2024-25.pdfWhat is the TDS Return Filing Due Date for FY 2024-25.pdf
What is the TDS Return Filing Due Date for FY 2024-25.pdf
seoforlegalpillers
 
5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer
ofm712785
 
Unveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdfUnveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdf
Sam H
 
Brand Analysis for an artist named Struan
Brand Analysis for an artist named StruanBrand Analysis for an artist named Struan
Brand Analysis for an artist named Struan
sarahvanessa51503
 
Exploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social DreamingExploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social Dreaming
Nicola Wreford-Howard
 
Skye Residences | Extended Stay Residences Near Toronto Airport
Skye Residences | Extended Stay Residences Near Toronto AirportSkye Residences | Extended Stay Residences Near Toronto Airport
Skye Residences | Extended Stay Residences Near Toronto Airport
marketingjdass
 
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-indiafalcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
Falcon Invoice Discounting
 
Discover the innovative and creative projects that highlight my journey throu...
Discover the innovative and creative projects that highlight my journey throu...Discover the innovative and creative projects that highlight my journey throu...
Discover the innovative and creative projects that highlight my journey throu...
dylandmeas
 
Lookback Analysis
Lookback AnalysisLookback Analysis
Lookback Analysis
Safe PaaS
 
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptxTaurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
my Pandit
 
3.0 Project 2_ Developing My Brand Identity Kit.pptx
3.0 Project 2_ Developing My Brand Identity Kit.pptx3.0 Project 2_ Developing My Brand Identity Kit.pptx
3.0 Project 2_ Developing My Brand Identity Kit.pptx
tanyjahb
 
Set off and carry forward of losses and assessment of individuals.pptx
Set off and carry forward of losses and assessment of individuals.pptxSet off and carry forward of losses and assessment of individuals.pptx
Set off and carry forward of losses and assessment of individuals.pptx
HARSHITHV26
 
FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134
LR1709MUSIC
 
Improving profitability for small business
Improving profitability for small businessImproving profitability for small business
Improving profitability for small business
Ben Wann
 
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
BBPMedia1
 
Cracking the Workplace Discipline Code Main.pptx
Cracking the Workplace Discipline Code Main.pptxCracking the Workplace Discipline Code Main.pptx
Cracking the Workplace Discipline Code Main.pptx
Workforce Group
 
Buy Verified PayPal Account | Buy Google 5 Star Reviews
Buy Verified PayPal Account | Buy Google 5 Star ReviewsBuy Verified PayPal Account | Buy Google 5 Star Reviews
Buy Verified PayPal Account | Buy Google 5 Star Reviews
usawebmarket
 
Role of Remote Sensing and Monitoring in Mining
Role of Remote Sensing and Monitoring in MiningRole of Remote Sensing and Monitoring in Mining
Role of Remote Sensing and Monitoring in Mining
Naaraayani Minerals Pvt.Ltd
 

Recently uploaded (20)

CADAVER AS OUR FIRST TEACHER anatomt in your.pptx
CADAVER AS OUR FIRST TEACHER anatomt in your.pptxCADAVER AS OUR FIRST TEACHER anatomt in your.pptx
CADAVER AS OUR FIRST TEACHER anatomt in your.pptx
 
Memorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.pptMemorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.ppt
 
What is the TDS Return Filing Due Date for FY 2024-25.pdf
What is the TDS Return Filing Due Date for FY 2024-25.pdfWhat is the TDS Return Filing Due Date for FY 2024-25.pdf
What is the TDS Return Filing Due Date for FY 2024-25.pdf
 
5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer
 
Unveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdfUnveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdf
 
Brand Analysis for an artist named Struan
Brand Analysis for an artist named StruanBrand Analysis for an artist named Struan
Brand Analysis for an artist named Struan
 
Exploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social DreamingExploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social Dreaming
 
Skye Residences | Extended Stay Residences Near Toronto Airport
Skye Residences | Extended Stay Residences Near Toronto AirportSkye Residences | Extended Stay Residences Near Toronto Airport
Skye Residences | Extended Stay Residences Near Toronto Airport
 
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-indiafalcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
 
Discover the innovative and creative projects that highlight my journey throu...
Discover the innovative and creative projects that highlight my journey throu...Discover the innovative and creative projects that highlight my journey throu...
Discover the innovative and creative projects that highlight my journey throu...
 
Lookback Analysis
Lookback AnalysisLookback Analysis
Lookback Analysis
 
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptxTaurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
 
3.0 Project 2_ Developing My Brand Identity Kit.pptx
3.0 Project 2_ Developing My Brand Identity Kit.pptx3.0 Project 2_ Developing My Brand Identity Kit.pptx
3.0 Project 2_ Developing My Brand Identity Kit.pptx
 
Set off and carry forward of losses and assessment of individuals.pptx
Set off and carry forward of losses and assessment of individuals.pptxSet off and carry forward of losses and assessment of individuals.pptx
Set off and carry forward of losses and assessment of individuals.pptx
 
FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134
 
Improving profitability for small business
Improving profitability for small businessImproving profitability for small business
Improving profitability for small business
 
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
 
Cracking the Workplace Discipline Code Main.pptx
Cracking the Workplace Discipline Code Main.pptxCracking the Workplace Discipline Code Main.pptx
Cracking the Workplace Discipline Code Main.pptx
 
Buy Verified PayPal Account | Buy Google 5 Star Reviews
Buy Verified PayPal Account | Buy Google 5 Star ReviewsBuy Verified PayPal Account | Buy Google 5 Star Reviews
Buy Verified PayPal Account | Buy Google 5 Star Reviews
 
Role of Remote Sensing and Monitoring in Mining
Role of Remote Sensing and Monitoring in MiningRole of Remote Sensing and Monitoring in Mining
Role of Remote Sensing and Monitoring in Mining
 

Struts2

  • 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.