Vous êtes sur la page 1sur 3

Struts (A open source Web Application Framework)

================================================
Pre-requisites:
i) Servlets & JSP
ii) Session management and Client state persistence
(cookies, URL rewriting, hidden fields)
ii) response.sendRedirect(), RequestDispatcher.forward()
iii) Knowledge on request, session and application scopes
iv) URL patterns and Filters (Struts 2.0)
v) How multiple form requests can be processed in a single servlet?
vi) Composite View
vii) Custom tag libraries
(Tag Implementation Class, .tld file, namespace, how to use <%@ taglib %>)
Course Content of Struts 1.3
============================
+ What is Architecture, Design Pattern, Framework
+ MVC and MVC2 Architectures
+ Building MVC based applications using JSP Model 1, Model 2, Model 3, Model 4 a
rchitectures
+ What is FrontController servlet?
+ Struts Architecture?
+ Some important classes in Struts architecture
JSP (Composite View), ActionServlet, struts-config.xml, web.xml, ModuleConfig, R
equestDispatcher, ActionForm, Action class and ActionForward classes.
+ Files required to develop struts web application
+ First example is on I18N (InternationalizatioN)
+ Application on processing form data in Struts (in this application we will use
DAO for DB operations)
+ Application on DynaActionForm
+ Appl on DynaValidatorForm
(the 16 Struts in-built validations, client side and server validations, user de
fined validations)
+ Appl on preventing Duplicate form submission in struts using token concept
+ Applications on 9 Action classes
i) Action
ii) DispatchAction
iii) EventDispatchAction
iv) LookupDispatchAction
v) MappingDispatchAction
vi) IncludeAction
vii) ForwardAction
viii) SwitchAction
ix) DownloadAction
+ Layout management in Struts using Tiles
i) Simple Tiles definitions
ii) Tiles Inheritance
Architecture
============

+ Pattern Oriented Software Architecture (POSA)


- Frank Buschmann et al
+ Reusable Software Object Oriented Design Patterns
- GoF
Erich Gamma
Richard Helm
Ivary jackobson
James Rumbagh
+ Couple of Architectural Patterns are:
MVC (Model-View-Control) web based & standalone GUI applications uses
PAC (Presentation-Abstract-Control) reporting tools
Broker Distributed applications uses
Blackboard Embedded Systems
+ Couple of Design Patterns are:
Singleton
AbstractFactory
FactoryMethod
Adapter
Iterator
CoR (Chain of Responsibility)
Decorator
Iterator
Software architecture classifies/divisions/divides into how many layers/parts th
e application want to be divided into based on the roles they (layer) perform.
The most commonly used architectural pattern in client server applications is MV
C (Model-View-Control).
The roles recommended to layer of MVC arch are:
i) View layer
Layout management (3R2C, 3R3C,4R1C layouts)
Placing components on layout
Content/Page reusability
Event handling (itself submits form data to controller)
ii) Control layer
reading form data
validates form data
form processing logic/business logic
determines whether the request want to be further send to model layer for persis
tence (insert/update/select/delete) or not
sending response/error view to browser/client system
iii) model layer
persistence operations
ensuring consistency (read committed data during read-only operations, apply rec
ord lock during update operations and table lock during insert and delete operat
ions)
In java web applications MVC architectures are implemented in 4 ways:
======================
i) JSP Model 1 arch
i) JSP Model 2 arch
i) JSP Model 3 arch

i) JSP Model 4 arch


JSP Model 1 arch
---------------In JSP Model 1 architecture:
+ Request and ResponseView are implemented using HTML/JSP
+ Controller is implemented using Servlet
+ DAO acts as Model class
In JSP Model 2 architecture:
+ Request and Response Views remain developed in HTML/JSP
+ But JSP is used in Control layer
+ DAO remains in Model layer
In JSP Model 3 architecture:
+ Filter used in Control layer
In JSP Model 4 architecture:
+ JSP with Custom tag/User defined tag is used in Control layer
The origin of MVC 2 architecture
================================
+ The origin to MVC 2 is Front controller design pattern
+ Front Controller design pattern?
The aim of Front controller design pattern is to process multiple form requests
in a single controller class (servlet)
To substitute multiple controllers (servlets) with a single controller (servlet)
, then the controller must be designed and implemented in such a way that it sho
uld read form data from any number of HTML/JSP forms, validates fields, displays
error messages on browser if field validations fails and then must send control
to a seperate form processing logic/business logic class if field validations a
re successful.
Such a seperation of business logic processing from controller leads to increase
in one more layer of MVC architecture. Such an architecture is called as MVC 2
architecture.
Abstract view of Struts architecture
====================================

Vous aimerez peut-être aussi