SlideShare a Scribd company logo
1 of 48
1
2
Struts2 course topics
• Chapter 1: Evolution of web applications
• Chapter 2: Struts2 Installation and configuration
• Chapter 3: Actions and results
• Chapter 4: OGNL - Object-Graph Navigation Language
• Chapter 5: Form Tags
• Chapter 6: Generic Tags
• Chapter 7: type conversion
• Chapter 8: Input validation
• Chapter 9: Message Handling and Internationalization
• Chapter 10: Model Driven and Prepare Interceptors
• Chapter 11: The Persistence Layer
• Chapter 12: File upload and File download
• Chapter 13: Securing Struts2 applications in Tomcat
• Chapter 14: Custom Interceptors
• Chapter 15: Custom Result Types
• Chapter 16: Preventing Double Submits
• Chapter 17: The Execute and Wait Interceptor
• Chapter 18: Decorating Struts2 with Tiles
• Chapter 19: Decorating Struts2 with SiteMesh
• Chapter 20: Zero Configuration
• Chapter 21: AJAX
3
Evolution of web applications
Agenda
• Live without MVC
• Using the mediator pattern
• MVC model 1
• MVC model 2
• Struts1 implementation of MVC2
• Struts2 implementation of MVC2
4
Live without MVC
5
Live without MVC
Home Catalog
Login Checkout
Caos
6
No MVC – Improved
Using the mediator pattern
7
No MVC – Improved
Using the mediator pattern
Home Catalog
Login Checkout
Mediator
Better!!!
8
Model View Controller (MVC)
9
Model View Controller (MVC)
• Definition of MVC
– Model–View–Controller (MVC) is an architectural pattern
used in software develpment.
– The pattern isolates business logic from user interaction
(input or control) and presentation, permitting
independent development, testing and maintenance of
each one.
– In this case the controller implements the mediator
patters
10
Model View Controller (MVC)
Controller
View
Model
Model
Represents the data on which the
application operates.
View
Renders the model into a form
suitable for interaction, typically a
user interface element. Multiple
views can exist for a single model for
different purposes.
Controller
Processes and responds to events
(typically user actions) and may
indirectly invoke changes on the
model.
11
MVC model 1
12
MVC model 1
JSP
Java
Beans
Browser
Request
Response
Database
13
MVC model 1
• Shortcomings of MVC1
– The model is page - centric
– Difficult of code maintenaince
– Mixing of HTML + Java code is a problem
14
MVC model 1 - Exercise
• Example of MVC 1
implementation using Servlets /
JSP
– struts2-01a
15
MVC model 1 - Exercise
• Objective
Note this
16
MVC model 1 - Exercise
Controller
Model
View
17
MVC model 1 - Exercise
// ControllerServlet.java
String action = request.getParameter("action");
// execute an action
if (action.equals("displayAddProductForm")) {
// Action for displayAddProductForm
} else if (action.equals("saveProduct")) {
// Populate the model
ProductTO product = new ProductTO();
product.setProductName(request.getParameter("productName"));
product.setDescription(request.getParameter("description"));
product.setPrice(request.getParameter("price"));
// code for persisting the ProductTO object goes here
request.setAttribute("product", product);
}
// forward to a view
String dispatchUrl = null;
if (action.equals("displayAddProductForm")) {
dispatchUrl = "/jsp/displayAddProductForm.jsp";
} else if (action.equals("saveProduct")) {
dispatchUrl = "/jsp/displaySavedProduct.jsp";
}
if (dispatchUrl != null) {
RequestDispatcher rd = request.getRequestDispatcher(dispatchUrl);
rd.forward(request, response);
}
Code hard to maintain
Mixing view, model
and controller
18
MVC model 2
19
MVC model 2
Servlets
(controller)
Java
Beans
(Model)
Browser
Request
Response
Database
JSP
(view)
20
MVC model 2
• Benefits of Model 2
– rapid to build
– easier to test
– easier to maintain
– easier to extend
21
MVC model 2 - Exercise
• Example of MVC2
implementation
using Servlets / JSP creating our
own framework
– struts2-01b
22
MVC model 2 - Exercise
• Objective
Note this
23
MVC model 2 - Exercise
Controller
Model
View
View manager
Action manager
24
MVC model 2 - Exercise
// ControllerServlet.java
ActionManager actionManager = new ActionManager();
actionManager.execute(request, response);
ViewManager viewManager = new ViewManager();
viewManager.execute(request, response);
25
MVC model 2 - Exercise
• Conclusion
• By spliting the work into an ActionManager and a
ViewManager you can get a clearer and more
maintainable code
• Framweorks as Struts and Struts2 have already
built-in action and view managers making easy for
us the development
26
Struts1 implementation of
MVC2
27
Struts1 implementation of
MVC2
Controller
Servlet
Browser
Request
Response
View
JSP
Action
Dispatch
Model
Forward
28
Struts1 implementation of
MVC2
29
Struts1 implementation of
MVC2
• Advantages of struts ( 1 or 2)
– page navigation management
– user input validation
– consistent layout
– extensibility
• If you uses Struts you should stick to the following unwritten
rules:
– No Java code in JSPs, all business logic should reside in
Java classes called action classes.
– Use the Expression Language (if you are using JSP 2.0) or
JSTL in JSPs to access business model.
– Little or no writing of custom tags (because they are hard
to code).
30
Struts1 implementation of
MVC2 - Exercise
• Example of MVC2
implementation
using Struts1
– struts2-01c
31
Struts1 implementation of
MVC2 - Exercise
• Objective
Note this
32
Struts1 implementation of
MVC2 - Exercise
Model
View
Controller
33
Struts1 implementation of
MVC2 - Exercise
• Struts-config.xml (controller)
<struts-config>
<action-mappings>
<action path="/displayAddProductForm“
forward="/jsp/displayAddProductForm.jsp" />
<action path="/saveProduct" scope="request"
type="app01c.action.SaveProductAction">
<forward name="success“
path="/jsp/displaySavedProduct.jsp" />
</action>
</action-mappings>
</struts-config>
34
Struts2 implementation of
MVC2
35
Struts2 implementation of
MVC2
Controller
Filter
Browser
Request
Response
View
JSP
Action /
Result
Interceptors
Interceptors
36
Struts2 implementation of
MVC2
37
Struts2 implementation of
MVC2 - Exercise
• Example of MVC2
implementation
using Struts2
– struts2-02a
38
Struts2 implementation of
MVC2 - Exercise
• Objective
Note this
39
Struts2 implementation of
MVC2 - Exercise
Model
View
Controller
40
Struts2 implementation of
MVC2 - Exercise
• Struts.xml (controller)
<package name="app02a" namespace=""
extends="struts-default">
<action name="Product_input">
<result>/jsp/Product.jsp</result>
</action>
<action name="Product_save"
class="app02a.Product" method="execute">
<result>/jsp/Details.jsp</result>
</action>
</package>
41
Struts1 vs Struts2 comparison
Feature Struts 1 Struts 2
Action
classes
Struts 1 requires Action classes to
extend an abstract base class. A
common problem in Struts 1 is
programming to abstract classes
instead of interfaces.
An Struts 2 Action may implement
an Action interface, along with other
interfaces to enable optional and custom
services. Struts 2 provides a base
ActionSupport class to implement commonly
used interfaces. Albeit, the Action interface
is not required. Any POJO object with
a execute signature can be used as an Struts
2 Action object.
Threading
Model
Struts 1 Actions are singletons and
must be thread-safe since there will
only be one instance of a class to
handle all requests for that Action.
The singleton strategy places
restrictions on what can be done
with Struts 1 Actions and requires
extra care to develop.
Struts 2 Action objects are instantiated for
each request, so there are no thread-safety
issues. (In practice, servlet containers
generate many throw-away objects per
request, and one more object does not
impose a performance penalty or impact
garbage collection.)
42
Struts1 vs Struts2 comparison
Servlet
Dependency
Struts 1 Actions have dependencies
on the servlet API since the
HttpServletRequest and
HttpServletResponse is passed to
the execute method when an
Action is invoked.
Struts 2 Actions are not coupled to a
container. Most often the servlet contexts
are represented as simple Maps, allowing
Actions to be tested in isolation.
Struts 2 Actions can still access the original
request and response, if required. However,
other architectural elements reduce or
eliminate the need to access the
HttpServetRequest or HttpServletResponse
directly.
Testability A major hurdle to testing Struts 1
Actions is that the execute method
exposes the Servlet API. A third-
party extension, Struts TestCase,
offers a set of mock object for
Struts 1.
Struts 2 Actions can be tested by
instantiating the Action, setting properties,
and invoking methods. Dependency
Injection support also makes testing simpler.
43
Struts1 vs Struts2 comparison
Harvesting
Input
Struts 1 uses an ActionForm object
to capture input. Like Actions, all
ActionForms must extend a base
class. Since other JavaBeans cannot
be used as ActionForms, developers
often create redundant classes to
capture input.
DynaBeans can used as an
alternative to creating conventional
ActionForm classes, but, here too,
developers may be redescribing
existing JavaBeans.
Struts 2 uses Action properties as input
properties, eliminating the need for a second
input object. Input properties may be rich
object types which may have their own
properties.
The Action properties can be accessed from
the web page via the taglibs. Struts 2 also
supports the ActionForm pattern, as well as
POJO form objects and POJO Actions.
Rich object types, including business or
domain objects, can be used as input/output
objects. The ModelDriven feature simplifies
taglb references to POJO input objects.
Expression
Language
Struts 1 integrates with JSTL, so it
uses the JSTL EL. The EL has basic
object graph traversal, but
relatively weak collection and
indexed property support.
Struts 2 can use JSTL, but the framework also
supports a more powerful and flexible
expression language called "Object Graph
Notation Language" (OGNL).
44
Struts1 vs Struts2 comparison
Type
Conversion
Struts 1 ActionForm properties are
usually all Strings. Struts 1 uses
Commons-Beanutils for type
conversion. Converters are per-
class, and not configurable per
instance.
Struts 2 uses OGNL for type conversion.
The framework includes converters for
basic and common object types and
primitives.
Validation Struts 1 supports manual validation
via avalidate method on the
ActionForm, or through an
extension to the Commons
Validator. Classes can have
different validation contexts for the
same class, but cannot chain to
validations on sub-objects.
Struts 2 supports manual validation via
the validate method and the XWork
Validation framework. The Xwork
Validation Framework supports chaining
validation into sub-properties using the
validations defined for the properties
class type and the validation context.
Control Of
Action
Execution
Struts 1 supports separate Request
Processors (lifecycles) for each
module, but all the Actions in the
module must share the same
lifecycle.
Struts 2 supports creating different
lifecycles on a per Action basis via
Interceptor Stacks. Custom stacks can be
created and used with different Actions,
as needed.
45
Struts2 Architecture
46
Struts2
Architecture
47
Struts2 Architecture
• DO NOT WORRY!!!
• You do not need to understand everything now
• Just understanding what is the action and the result you get
90% what you need of the framework
48
Resources
http://struts.apache.org
To download example code for this chapter go to:
http://www.jeetrainers.com

More Related Content

What's hot

Struts2
Struts2Struts2
Struts2yuvalb
 
Scalable JavaScript Application Architecture 2012
Scalable JavaScript Application Architecture 2012Scalable JavaScript Application Architecture 2012
Scalable JavaScript Application Architecture 2012Nicholas Zakas
 
Dynamic Groovy Edges
Dynamic Groovy EdgesDynamic Groovy Edges
Dynamic Groovy EdgesJimmy Ray
 
Session 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPSession 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPPawanMM
 
ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]Mohamed Abdeen
 
Cleaning your architecture with android architecture components
Cleaning your architecture with android architecture componentsCleaning your architecture with android architecture components
Cleaning your architecture with android architecture componentsDebora Gomez Bertoli
 
Android Architecture Components
Android Architecture ComponentsAndroid Architecture Components
Android Architecture ComponentsDarshan Parikh
 
An Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDDAn Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDDAhmed Ehab AbdulAziz
 
Building a JavaScript Module Framework at Gilt
Building a JavaScript Module Framework at GiltBuilding a JavaScript Module Framework at Gilt
Building a JavaScript Module Framework at GiltEric Shepherd
 
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис ЛебедевВстреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис ЛебедевCocoaHeads
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Naresh Chintalcheru
 
Developing Agile Java Applications using Spring tools
Developing Agile Java Applications using Spring toolsDeveloping Agile Java Applications using Spring tools
Developing Agile Java Applications using Spring toolsSathish Chittibabu
 
MV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoaMV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoaYi-Shou Chen
 
Built to last javascript for enterprise
Built to last   javascript for enterpriseBuilt to last   javascript for enterprise
Built to last javascript for enterpriseMarjan Nikolovski
 
Struts 2 - Hibernate Integration
Struts 2 - Hibernate Integration Struts 2 - Hibernate Integration
Struts 2 - Hibernate Integration Hitesh-Java
 

What's hot (20)

Struts2
Struts2Struts2
Struts2
 
Scalable JavaScript Application Architecture 2012
Scalable JavaScript Application Architecture 2012Scalable JavaScript Application Architecture 2012
Scalable JavaScript Application Architecture 2012
 
Skillwise Struts.x
Skillwise Struts.xSkillwise Struts.x
Skillwise Struts.x
 
Struts framework
Struts frameworkStruts framework
Struts framework
 
Dynamic Groovy Edges
Dynamic Groovy EdgesDynamic Groovy Edges
Dynamic Groovy Edges
 
Struts2.x
Struts2.xStruts2.x
Struts2.x
 
Session 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPSession 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOP
 
ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]
 
Cleaning your architecture with android architecture components
Cleaning your architecture with android architecture componentsCleaning your architecture with android architecture components
Cleaning your architecture with android architecture components
 
Android Architecture Components
Android Architecture ComponentsAndroid Architecture Components
Android Architecture Components
 
An Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDDAn Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDD
 
Building a JavaScript Module Framework at Gilt
Building a JavaScript Module Framework at GiltBuilding a JavaScript Module Framework at Gilt
Building a JavaScript Module Framework at Gilt
 
Desiging for Modularity with Java 9
Desiging for Modularity with Java 9Desiging for Modularity with Java 9
Desiging for Modularity with Java 9
 
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис ЛебедевВстреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC
 
Developing Agile Java Applications using Spring tools
Developing Agile Java Applications using Spring toolsDeveloping Agile Java Applications using Spring tools
Developing Agile Java Applications using Spring tools
 
MV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoaMV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoa
 
Intro into MVC 1.0
Intro into MVC 1.0Intro into MVC 1.0
Intro into MVC 1.0
 
Built to last javascript for enterprise
Built to last   javascript for enterpriseBuilt to last   javascript for enterprise
Built to last javascript for enterprise
 
Struts 2 - Hibernate Integration
Struts 2 - Hibernate Integration Struts 2 - Hibernate Integration
Struts 2 - Hibernate Integration
 

Viewers also liked

Apache Struts 2 Framework
Apache Struts 2 FrameworkApache Struts 2 Framework
Apache Struts 2 FrameworkEmprovise
 
Web Issues
Web IssuesWeb Issues
Web Issuestterrill
 
Website design and devlopment
Website design and devlopmentWebsite design and devlopment
Website design and devlopmentPX Media
 
Intro to Front-End Web Devlopment
Intro to Front-End Web DevlopmentIntro to Front-End Web Devlopment
Intro to Front-End Web Devlopmentdamonras
 
The Evolution of the Web
The Evolution of the WebThe Evolution of the Web
The Evolution of the WebCJ Gammon
 
Issues of web design and structure
Issues of web design and structureIssues of web design and structure
Issues of web design and structureDotTourism
 
Markup language classification, designing static and dynamic
Markup language classification, designing static and dynamicMarkup language classification, designing static and dynamic
Markup language classification, designing static and dynamicAnkita Bhalla
 
Website Design Issues
Website Design IssuesWebsite Design Issues
Website Design Issuesrakudepp
 
Web1, web2 and web 3
Web1, web2 and web 3Web1, web2 and web 3
Web1, web2 and web 3mercedeh37
 
CamelOne 2012 - Spoilt for Choice: Which Integration Framework to use?
CamelOne 2012 - Spoilt for Choice: Which Integration Framework to use?CamelOne 2012 - Spoilt for Choice: Which Integration Framework to use?
CamelOne 2012 - Spoilt for Choice: Which Integration Framework to use?Kai Wähner
 
Web Evolution Nova Spivack Twine
Web Evolution   Nova Spivack   TwineWeb Evolution   Nova Spivack   Twine
Web Evolution Nova Spivack TwineNova Spivack
 
Web 1.0 to Web 3.0 - Evolution of the Web and its Various Challenges
Web 1.0 to Web 3.0 - Evolution of the Web and its Various ChallengesWeb 1.0 to Web 3.0 - Evolution of the Web and its Various Challenges
Web 1.0 to Web 3.0 - Evolution of the Web and its Various ChallengesSubhash Basistha
 
Fundamentals of Web for Non-Developers
Fundamentals of Web for Non-DevelopersFundamentals of Web for Non-Developers
Fundamentals of Web for Non-DevelopersLemi Orhan Ergin
 

Viewers also liked (20)

Apache Struts 2 Framework
Apache Struts 2 FrameworkApache Struts 2 Framework
Apache Struts 2 Framework
 
Web Issues
Web IssuesWeb Issues
Web Issues
 
Website design and devlopment
Website design and devlopmentWebsite design and devlopment
Website design and devlopment
 
Intro to Front-End Web Devlopment
Intro to Front-End Web DevlopmentIntro to Front-End Web Devlopment
Intro to Front-End Web Devlopment
 
Class2
Class2Class2
Class2
 
The Evolution of the Web
The Evolution of the WebThe Evolution of the Web
The Evolution of the Web
 
Issues of web design and structure
Issues of web design and structureIssues of web design and structure
Issues of web design and structure
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Markup Languages
Markup LanguagesMarkup Languages
Markup Languages
 
Markup language classification, designing static and dynamic
Markup language classification, designing static and dynamicMarkup language classification, designing static and dynamic
Markup language classification, designing static and dynamic
 
Web evolution (Part I)
Web evolution (Part I) Web evolution (Part I)
Web evolution (Part I)
 
Client side and server side scripting
Client side and server side scriptingClient side and server side scripting
Client side and server side scripting
 
Markup Languages
Markup Languages Markup Languages
Markup Languages
 
Website Design Issues
Website Design IssuesWebsite Design Issues
Website Design Issues
 
Web1, web2 and web 3
Web1, web2 and web 3Web1, web2 and web 3
Web1, web2 and web 3
 
CamelOne 2012 - Spoilt for Choice: Which Integration Framework to use?
CamelOne 2012 - Spoilt for Choice: Which Integration Framework to use?CamelOne 2012 - Spoilt for Choice: Which Integration Framework to use?
CamelOne 2012 - Spoilt for Choice: Which Integration Framework to use?
 
Web Evolution Nova Spivack Twine
Web Evolution   Nova Spivack   TwineWeb Evolution   Nova Spivack   Twine
Web Evolution Nova Spivack Twine
 
Web 1.0 2.0-3.0-4.0 Overview
Web 1.0 2.0-3.0-4.0 OverviewWeb 1.0 2.0-3.0-4.0 Overview
Web 1.0 2.0-3.0-4.0 Overview
 
Web 1.0 to Web 3.0 - Evolution of the Web and its Various Challenges
Web 1.0 to Web 3.0 - Evolution of the Web and its Various ChallengesWeb 1.0 to Web 3.0 - Evolution of the Web and its Various Challenges
Web 1.0 to Web 3.0 - Evolution of the Web and its Various Challenges
 
Fundamentals of Web for Non-Developers
Fundamentals of Web for Non-DevelopersFundamentals of Web for Non-Developers
Fundamentals of Web for Non-Developers
 

Similar to Struts2 course chapter 1: Evolution of Web Applications

important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questionssurendray
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2Long Nguyen
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2divzi1913
 
Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts weili_at_slideshare
 
Struts 2 – Architecture
Struts 2 – ArchitectureStruts 2 – Architecture
Struts 2 – ArchitectureDucat India
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issuesPrashant Seth
 
Java Web Programming [7/9] : Struts2 Basics
Java Web Programming [7/9] : Struts2 BasicsJava Web Programming [7/9] : Struts2 Basics
Java Web Programming [7/9] : Struts2 BasicsIMC Institute
 
What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2Santosh Singh Paliwal
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questionsjbashask
 
Strut2-Spring-Hibernate
Strut2-Spring-HibernateStrut2-Spring-Hibernate
Strut2-Spring-HibernateJay Shah
 

Similar to Struts2 course chapter 1: Evolution of Web Applications (20)

Struts2
Struts2Struts2
Struts2
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
 
Struts Basics
Struts BasicsStruts Basics
Struts Basics
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Struts
StrutsStruts
Struts
 
Struts
StrutsStruts
Struts
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Struts 1
Struts 1Struts 1
Struts 1
 
Struts Interceptors
Struts InterceptorsStruts Interceptors
Struts Interceptors
 
Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts
 
Struts 2 – Architecture
Struts 2 – ArchitectureStruts 2 – Architecture
Struts 2 – Architecture
 
strut2
strut2strut2
strut2
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issues
 
Java Web Programming [7/9] : Struts2 Basics
Java Web Programming [7/9] : Struts2 BasicsJava Web Programming [7/9] : Struts2 Basics
Java Web Programming [7/9] : Struts2 Basics
 
Struts ppt 1
Struts ppt 1Struts ppt 1
Struts ppt 1
 
What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questions
 
MVC
MVCMVC
MVC
 
Strut2-Spring-Hibernate
Strut2-Spring-HibernateStrut2-Spring-Hibernate
Strut2-Spring-Hibernate
 

More from JavaEE Trainers

Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3JavaEE Trainers
 
Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009JavaEE Trainers
 
Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008JavaEE Trainers
 
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)JavaEE Trainers
 
Servlet/JSP course chapter 1: Introduction to servlets
Servlet/JSP course chapter 1: Introduction to servletsServlet/JSP course chapter 1: Introduction to servlets
Servlet/JSP course chapter 1: Introduction to servletsJavaEE Trainers
 
Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course JavaEE Trainers
 
Jsp quick reference card
Jsp quick reference cardJsp quick reference card
Jsp quick reference cardJavaEE Trainers
 
jsp, javaserver pages, Card20
jsp, javaserver pages, Card20jsp, javaserver pages, Card20
jsp, javaserver pages, Card20JavaEE Trainers
 
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
 
Struts2 Course: Introduction
Struts2 Course: IntroductionStruts2 Course: Introduction
Struts2 Course: IntroductionJavaEE Trainers
 

More from JavaEE Trainers (10)

Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3
 
Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009
 
Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008
 
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
 
Servlet/JSP course chapter 1: Introduction to servlets
Servlet/JSP course chapter 1: Introduction to servletsServlet/JSP course chapter 1: Introduction to servlets
Servlet/JSP course chapter 1: Introduction to servlets
 
Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course
 
Jsp quick reference card
Jsp quick reference cardJsp quick reference card
Jsp quick reference card
 
jsp, javaserver pages, Card20
jsp, javaserver pages, Card20jsp, javaserver pages, Card20
jsp, javaserver pages, Card20
 
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
 
Struts2 Course: Introduction
Struts2 Course: IntroductionStruts2 Course: Introduction
Struts2 Course: Introduction
 

Recently uploaded

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Struts2 course chapter 1: Evolution of Web Applications

  • 1. 1
  • 2. 2 Struts2 course topics • Chapter 1: Evolution of web applications • Chapter 2: Struts2 Installation and configuration • Chapter 3: Actions and results • Chapter 4: OGNL - Object-Graph Navigation Language • Chapter 5: Form Tags • Chapter 6: Generic Tags • Chapter 7: type conversion • Chapter 8: Input validation • Chapter 9: Message Handling and Internationalization • Chapter 10: Model Driven and Prepare Interceptors • Chapter 11: The Persistence Layer • Chapter 12: File upload and File download • Chapter 13: Securing Struts2 applications in Tomcat • Chapter 14: Custom Interceptors • Chapter 15: Custom Result Types • Chapter 16: Preventing Double Submits • Chapter 17: The Execute and Wait Interceptor • Chapter 18: Decorating Struts2 with Tiles • Chapter 19: Decorating Struts2 with SiteMesh • Chapter 20: Zero Configuration • Chapter 21: AJAX
  • 3. 3 Evolution of web applications Agenda • Live without MVC • Using the mediator pattern • MVC model 1 • MVC model 2 • Struts1 implementation of MVC2 • Struts2 implementation of MVC2
  • 5. 5 Live without MVC Home Catalog Login Checkout Caos
  • 6. 6 No MVC – Improved Using the mediator pattern
  • 7. 7 No MVC – Improved Using the mediator pattern Home Catalog Login Checkout Mediator Better!!!
  • 9. 9 Model View Controller (MVC) • Definition of MVC – Model–View–Controller (MVC) is an architectural pattern used in software develpment. – The pattern isolates business logic from user interaction (input or control) and presentation, permitting independent development, testing and maintenance of each one. – In this case the controller implements the mediator patters
  • 10. 10 Model View Controller (MVC) Controller View Model Model Represents the data on which the application operates. View Renders the model into a form suitable for interaction, typically a user interface element. Multiple views can exist for a single model for different purposes. Controller Processes and responds to events (typically user actions) and may indirectly invoke changes on the model.
  • 13. 13 MVC model 1 • Shortcomings of MVC1 – The model is page - centric – Difficult of code maintenaince – Mixing of HTML + Java code is a problem
  • 14. 14 MVC model 1 - Exercise • Example of MVC 1 implementation using Servlets / JSP – struts2-01a
  • 15. 15 MVC model 1 - Exercise • Objective Note this
  • 16. 16 MVC model 1 - Exercise Controller Model View
  • 17. 17 MVC model 1 - Exercise // ControllerServlet.java String action = request.getParameter("action"); // execute an action if (action.equals("displayAddProductForm")) { // Action for displayAddProductForm } else if (action.equals("saveProduct")) { // Populate the model ProductTO product = new ProductTO(); product.setProductName(request.getParameter("productName")); product.setDescription(request.getParameter("description")); product.setPrice(request.getParameter("price")); // code for persisting the ProductTO object goes here request.setAttribute("product", product); } // forward to a view String dispatchUrl = null; if (action.equals("displayAddProductForm")) { dispatchUrl = "/jsp/displayAddProductForm.jsp"; } else if (action.equals("saveProduct")) { dispatchUrl = "/jsp/displaySavedProduct.jsp"; } if (dispatchUrl != null) { RequestDispatcher rd = request.getRequestDispatcher(dispatchUrl); rd.forward(request, response); } Code hard to maintain Mixing view, model and controller
  • 20. 20 MVC model 2 • Benefits of Model 2 – rapid to build – easier to test – easier to maintain – easier to extend
  • 21. 21 MVC model 2 - Exercise • Example of MVC2 implementation using Servlets / JSP creating our own framework – struts2-01b
  • 22. 22 MVC model 2 - Exercise • Objective Note this
  • 23. 23 MVC model 2 - Exercise Controller Model View View manager Action manager
  • 24. 24 MVC model 2 - Exercise // ControllerServlet.java ActionManager actionManager = new ActionManager(); actionManager.execute(request, response); ViewManager viewManager = new ViewManager(); viewManager.execute(request, response);
  • 25. 25 MVC model 2 - Exercise • Conclusion • By spliting the work into an ActionManager and a ViewManager you can get a clearer and more maintainable code • Framweorks as Struts and Struts2 have already built-in action and view managers making easy for us the development
  • 29. 29 Struts1 implementation of MVC2 • Advantages of struts ( 1 or 2) – page navigation management – user input validation – consistent layout – extensibility • If you uses Struts you should stick to the following unwritten rules: – No Java code in JSPs, all business logic should reside in Java classes called action classes. – Use the Expression Language (if you are using JSP 2.0) or JSTL in JSPs to access business model. – Little or no writing of custom tags (because they are hard to code).
  • 30. 30 Struts1 implementation of MVC2 - Exercise • Example of MVC2 implementation using Struts1 – struts2-01c
  • 31. 31 Struts1 implementation of MVC2 - Exercise • Objective Note this
  • 32. 32 Struts1 implementation of MVC2 - Exercise Model View Controller
  • 33. 33 Struts1 implementation of MVC2 - Exercise • Struts-config.xml (controller) <struts-config> <action-mappings> <action path="/displayAddProductForm“ forward="/jsp/displayAddProductForm.jsp" /> <action path="/saveProduct" scope="request" type="app01c.action.SaveProductAction"> <forward name="success“ path="/jsp/displaySavedProduct.jsp" /> </action> </action-mappings> </struts-config>
  • 37. 37 Struts2 implementation of MVC2 - Exercise • Example of MVC2 implementation using Struts2 – struts2-02a
  • 38. 38 Struts2 implementation of MVC2 - Exercise • Objective Note this
  • 39. 39 Struts2 implementation of MVC2 - Exercise Model View Controller
  • 40. 40 Struts2 implementation of MVC2 - Exercise • Struts.xml (controller) <package name="app02a" namespace="" extends="struts-default"> <action name="Product_input"> <result>/jsp/Product.jsp</result> </action> <action name="Product_save" class="app02a.Product" method="execute"> <result>/jsp/Details.jsp</result> </action> </package>
  • 41. 41 Struts1 vs Struts2 comparison Feature Struts 1 Struts 2 Action classes Struts 1 requires Action classes to extend an abstract base class. A common problem in Struts 1 is programming to abstract classes instead of interfaces. An Struts 2 Action may implement an Action interface, along with other interfaces to enable optional and custom services. Struts 2 provides a base ActionSupport class to implement commonly used interfaces. Albeit, the Action interface is not required. Any POJO object with a execute signature can be used as an Struts 2 Action object. Threading Model Struts 1 Actions are singletons and must be thread-safe since there will only be one instance of a class to handle all requests for that Action. The singleton strategy places restrictions on what can be done with Struts 1 Actions and requires extra care to develop. Struts 2 Action objects are instantiated for each request, so there are no thread-safety issues. (In practice, servlet containers generate many throw-away objects per request, and one more object does not impose a performance penalty or impact garbage collection.)
  • 42. 42 Struts1 vs Struts2 comparison Servlet Dependency Struts 1 Actions have dependencies on the servlet API since the HttpServletRequest and HttpServletResponse is passed to the execute method when an Action is invoked. Struts 2 Actions are not coupled to a container. Most often the servlet contexts are represented as simple Maps, allowing Actions to be tested in isolation. Struts 2 Actions can still access the original request and response, if required. However, other architectural elements reduce or eliminate the need to access the HttpServetRequest or HttpServletResponse directly. Testability A major hurdle to testing Struts 1 Actions is that the execute method exposes the Servlet API. A third- party extension, Struts TestCase, offers a set of mock object for Struts 1. Struts 2 Actions can be tested by instantiating the Action, setting properties, and invoking methods. Dependency Injection support also makes testing simpler.
  • 43. 43 Struts1 vs Struts2 comparison Harvesting Input Struts 1 uses an ActionForm object to capture input. Like Actions, all ActionForms must extend a base class. Since other JavaBeans cannot be used as ActionForms, developers often create redundant classes to capture input. DynaBeans can used as an alternative to creating conventional ActionForm classes, but, here too, developers may be redescribing existing JavaBeans. Struts 2 uses Action properties as input properties, eliminating the need for a second input object. Input properties may be rich object types which may have their own properties. The Action properties can be accessed from the web page via the taglibs. Struts 2 also supports the ActionForm pattern, as well as POJO form objects and POJO Actions. Rich object types, including business or domain objects, can be used as input/output objects. The ModelDriven feature simplifies taglb references to POJO input objects. Expression Language Struts 1 integrates with JSTL, so it uses the JSTL EL. The EL has basic object graph traversal, but relatively weak collection and indexed property support. Struts 2 can use JSTL, but the framework also supports a more powerful and flexible expression language called "Object Graph Notation Language" (OGNL).
  • 44. 44 Struts1 vs Struts2 comparison Type Conversion Struts 1 ActionForm properties are usually all Strings. Struts 1 uses Commons-Beanutils for type conversion. Converters are per- class, and not configurable per instance. Struts 2 uses OGNL for type conversion. The framework includes converters for basic and common object types and primitives. Validation Struts 1 supports manual validation via avalidate method on the ActionForm, or through an extension to the Commons Validator. Classes can have different validation contexts for the same class, but cannot chain to validations on sub-objects. Struts 2 supports manual validation via the validate method and the XWork Validation framework. The Xwork Validation Framework supports chaining validation into sub-properties using the validations defined for the properties class type and the validation context. Control Of Action Execution Struts 1 supports separate Request Processors (lifecycles) for each module, but all the Actions in the module must share the same lifecycle. Struts 2 supports creating different lifecycles on a per Action basis via Interceptor Stacks. Custom stacks can be created and used with different Actions, as needed.
  • 47. 47 Struts2 Architecture • DO NOT WORRY!!! • You do not need to understand everything now • Just understanding what is the action and the result you get 90% what you need of the framework
  • 48. 48 Resources http://struts.apache.org To download example code for this chapter go to: http://www.jeetrainers.com