STRUTS Framework
STRUTS FRAMEWORK
The Jakarta struts project
The Jakarta struts project, an open-source project sponsored by the Apache Software Foundation, is a server side java implementation of the Model-View-Controller (MVC) design pattern.
The struts project was created by Craig McClanahan in May 2000.
What is Struts?
An open source development framework for
building web applications
Based on Model-View-Controller (MVC) design paradigm
Implementation of JSP Model 2 Architecture
Created by Craig McClanahan and donated
to Apache Software Foundation (ASF) in 2000
2nd release candidate of version 1.1 released
Struts Framework Features
Model 2
MVC Implementation
Internationalization(I18N) Support
Rich JSP Tag Libraries
Based on JSP, Servlet, XML, and Java
Supports Java’s Write Once, Run Anywhere Philosophy
Supports different model implementations
(JavaBeans, EJB, etc.)
Supports different presentation
implementations( JSP, XML/XSLT, etc)
Controller Components
ActionServlet – (Framework provided)
Request Processor –(Framework provided)
Action Classes –(You have to build these)
ActionServlet and RequestProcessor
(What Do They Really Do?)
Receive the HttpServletRequest
Automatically populate a JavaBean from the request parameters
Handle Locale and Content Type Issues
Determine which Action to invoke based on URI
Provide extension points
ActionServlet Facts
Extends javax.servlet.http.HttpServlet
Receives all framework requests
Selects proper application module
Delegates request handling to the RequestProcessor instance
One ActionServlet instance per web application
Default implementation provided by
framework (can extend if necessary)
May go away in future versions
The RequestProcessor Class
One instance per application module
Processes all requests for module
Invokes proper Action instance
Default implementation provided by
framework (can extend if necessary)
What’s an Action Class?
Extends org.apache.struts.action.Action
Overrides the execute() method
Acts as a bridge between user-invoked
URI and a business method (Command pattern)
Returns information about which view
should be rendered next
Part of the Controller, not the Model
Struts Includes Pre-built Action Classes
ForwardAction
DispatchAction
LookupDispatchAction
IncludeAction
SwitchAction
TAG LIBRARIES
Struts JSP Tag Libraries
HTML
Bean
Logic
Nested
Tiles
Template