Frame work Provides Core Services A framework is designed to offer a large number of related services centered on a broad theme. It is also base for components Ex:-car
1.A Model 1 application control is decentralized, because the current page being displayed determines the next page to display 2. Architecture usually leads to a significant amount of Java code embedded within the JSP page While this may not seem to be much of a problem for Java developers, it is certainly an issue if your JSP pages are created and maintained by designers
This approach typically results in the cleanest separation of presentation from content, leading to clear delineation of the roles and responsibilities of the developers and page designers.
When building physical structures Construction Engineers use support for each floor of building .Likewise, Software engineers also use some frame work to support each layer of their Applications. That why we call it as Struts.
WebDAV was a working group of the Internet Engineering Task Force .The name is an abbreviation for Web-based Distributed Authoring and Versioning and also refers to the set of extensions to the Hypertext Transfer Protocol (HTTP) that the group defined which allows users to collaboratively edit and manage files on remote World Wide Web servers
System State Beans Actual state of a system is normally represented as a set of one or more JavaBeans classes, whose properties define the current state. For small to medium sized applications, business logic beans might be ordinary JavaBeans that interact with system state beans passed as arguments, or ordinary JavaBeans that access a database using JDBC calls For larger applications, these beans will often be stateful or stateless Enterprise JavaBeans (EJBs).
Struts Ppt 1
What is Framework
What is Struts
Why we need it
Why is it called as
Elements & it’s
Model Elements &
View Elements &
Challenges Exist In Software
* Time shown with out day light savings
Projects must be developed
Projects must be in High-Quality.
Better code Maintainability.
Lower Cost for Developing
What is Framework
A software framework is a re-usable
design for a software system (or
A framework is a pre-built assembly
of components and is designed to
It is also base for components.
Advantages of Framework
Provide a procedure for the
development of Application.
Saves developers Time.
Provides same approach for all
developers for developing code and
Consistency in Software Design
Provide low-level services that
developers can use to speedup
It also reduces software development
and maintenance costs.
In the Model 1 the
JSP page is
and replying back to
Disadvantages of Model1
It does not have
usually leads to a
amount of Java
within the JSP
Developers and designers
must work on the same files!
This Model2 approach
combines the use of
both servlets and JSP,
using JSP to generate
the presentation layer
and servlets to perform
introduces a Servlet
browser and the
No processing/business logic within
the JSP page.
Model 2 applications are easier to
maintain and extend, because views
do not refer to each other directly.
The Model 2 controller servlet
provides a single point of control for
security and often encapsulates
incoming data into a form usable by
the back-end MVC model.
It also Provides unique responsibility
to each component and each is
Model 2 Components and
The Model portion of an
responsible for internal
state of the system, and
actions that can be taken
to change that state
Decide “How to do”
-Decide “What to do”
-The Controller portion of
the application is focused
on receiving requests
from the client ,deciding
what business logic is to
be performed ,and then
for producing the next
phase of user interface to
an appropriate View
What is Struts
An open source web application
framework based on j2ee and java
which implements the MVC design
pattern is called Struts.
Why is it called as Struts
Strut synonym is Iron-rod.
Why we use and what are the
advantages of Struts
It is open source.
Provides components for building
Web Applications that speedup
development and saves time for
It makes complex applications into
Built in Exception Handling
I18n support with resource bundles.
Built in validation framework.
JavaBean from the
Receives all framework
handling to the
ActionServlet dispatch request to Request
Processor(New from 1.1. previous this
behaviour was in Action servlet)
The work of Request Processor is:-
Mapping Action to FormBean.
Creating FormBean Object.
Calling reset() method of FormBean
Calling Validator of FormBean
If no form(jsp/html) validation errors calls execute
method in Action Class and finding response to
What is An Action Class
Overrides the execute() method
Acts as a bridge between user-
invoked URI and a business
Return information about which
The power and
flexibility of struts is
due to the extracting
across frame work.
mappings to turn
Tags in this file
The Model Components Model Components
middle tier components
(EJB, Javabeans, …)
Used to represent the
Internal state of the
Actions that can
change that state
Internal state of system
Action Form Extends the ActionForm class
Create one for each input form in the application
It is just like a java bean, Store data temporary,
reset default values to views, validate input view.
Hold state and behavior for user input.
If defined in the ActionMapping configuration
file, the Controller Servlet will perform the
Check for instance of bean of appropriate class
If no bean exists, one is created automatically
For every request parameter whose name corresponds
to the name of a property in the bean, the
corresponding setter method will be called
The updated ActionForm bean will be passed to the
Action Class execute() method when it is called,
making these values immediately available.
Struts JSP Tag Libraries
Html Tag & Bean Tag Libraries
Tags used to
link, submit ,text,
Tags used for
Logic ,Tiles & Nested Tag
Extended the base
struts tags to allow
them to relate to
each other in
Each part ("Tile")
of webpage can be
reused as often as
This reduces the
amount of markup
Template Tag Library
The "struts-template" tag library
contains tags that are useful in
creating dynamic JSP templates for
pages which share a common format.
These templates are best used when it
is likely that a layout shared by
several pages in your application will
change. The functionality provided by
these tags is similar to what can be
achieved using standard JSP include
Action Message & Action Error
Used to signify general purpose
informational and error messages
Rely on the resource bundles
JSP Tags can access them
Much of the
Struts Uses Java
Date ,Time and
Other Features Suported by
Dynamic Action Forms
Tiles integrated With Core
Validator Integrated With Core