Although Struts is a robust framework, there are alternative frameworks, environments for dynamic web application development.
The framework has as the central element of a DispatcherServlet . This Servlet dispatches requests to various handlers. The default handler is a Controller interface that offers a ModelAndViewhandleRequest() method. The framework has an included implementation hierarchy consisting of AbstractController, AbstractCommandController and SimpleFormController. Application controllers will typically be subclasses of those.
Shale Framework
The major features of Shale Framework are:
- View Controller
This framework performs for associating a java class with each of JSF View in an application.
- Dialog Manager
The framework also supports a mechanism to represents a conversation with a user. This requires multiple HTTP requests to implement.
- Application Manager
This framework also provides front controller properties that should get applied to every request.
- Validation
This framework also provides integration with the JCVF (Jakarta Commons Validator Framework). Based on a single set of configured validation rules the framework supports client/server-side validations.
- Integration
This framework supports integration with the spring framework.
- Clay
It is also an alternative approach to JSP where we define views in pure HTML.
The framework supports Test Framework which is set of mock objects and Junit test case base classes suitable for testing both the framework classes as well as application components built on top of the framework, The framework also supports an optional add-on library named Tiger Extensions that adds additionally easy to use features for Shale applications that run on Java Standard Edition.
The Struts Component Packages
The Struts framework supports various packages, which a developer can use to build the components for the web application.
org.apache.struts.action
This package provides support to build the controller components. It contains the controller classes such as ActionForm, ActionMessages, and several other required framework components.
org.apache.struts.actions
This package also provides special adapters between the incoming HTTP Request & the corresponding Business logic. It contains action classes such as DispatchAction, that can be used or extended by applications.
org.apache.struts.config
The config package contains configuration objects that correspond to elements that may be specified in the struts-config.xml configuration file. These configuration classes are in-memory representations of the struts configuration file.
org.apache.struts.taglib
These taglib package contains the tag handler classes for the Struts tags libraries.
org.apache.struts.tiles
The tiles framework provides the facility of building web pages simply by assembling reusable pieces of pages, often called tiles.
org.apache.struts.upload
The upload package provides facilities to upload files using multi-part requests. It includes classes used for uploading and downloading files from the local file system, using a browser.
org.apache.struts.util
The util package provides a variety of families of classes, to solve problems that are commonly encountered in building web applications.
org.apache.struts.validator
This package performs a series of classes to validate ActionForm type of input.
Summary
The roadmap for web application development started with static web pages developments, which were connected using hyperlinks. To create dynamic web content Common Gateway Interface (CGI) scripts were used initially for server-side programming. With the introduction of Servlet, Java became the technology of choice for the server as well as client-side programming. JSP was introduced as the extension of Servlet technology. JSP pages combinedJava code and HTML code to create a web application. Two modules for creating JSP based application, the second module ie module2formed the basis of Struts Framework. This framework typically is a reusable, semi-complete application that can be customized for a specific application domain.