Struts 2 Introduction
Apache Struts 2 is an elegant, extensible framework
for creating enterprise-ready Java web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time.
Apache Struts 2 was originally known as WebWork 2. After working independently for several years, the WebWork and Struts communities joined forces to create Struts2. This new version of Struts is simpler to use and closer to how Struts was always meant to be.
What is Framework ?
A web application framework is a piece of structural software that provides
automation of common tasks of the domain as well as a built-in architectural
solution that can be easily inherited by applications implemented
on the framework.
The high-level design of Struts 2 follows the well-established Model-View-Controller
design pattern. The MVC design pattern identifies three distinct concerns: model, view, and controller.
In Struts 2, these are implemented by the action, result,
respectively. When writing a Model 2 application, it is our responsibility to provide a controller as well as write action classes. Our controller must be able to do these:
- Determine from the URI what action to invoke.
- Instantiate the action class.
- If an action object exists, populate the action's properties with request parameters.
- If an action object exists, call the action method.
- Forward the request to a view (JSP).
Apache Struts 2 requires:
- Servlet API 2.4
- JSP API 2.0
- Java 5