Apache Struts 1
| Company type | Open source software |
|---|---|
| Industry | Software framework |
| Founded | May 2000 |
| Founder | Craig McClanahan |
| Headquarters | Global |
| Products | Java EE web application framework |
| Owner | Apache Software Foundation |
| Website | struts |
Apache Struts 1 is a widely used open-source web application framework designed for building Java EE web applications. It enhances the Java Servlet API by implementing a model–view–controller (MVC) design pattern. Originally developed by Craig McClanahan, the framework was contributed to the Apache Software Foundation in May 2000. Initially part of the Apache Jakarta Project under the name Jakarta Struts, it was elevated to a standalone Apache project in 2005.
The WebWork framework was created as an offshoot of Apache Struts, introducing improvements while preserving its foundational architecture. In December 2005, WebWork and Struts merged again, with WebWork 2.2 becoming known as Apache Struts 2. The first official release of Struts 2 occurred in February 2007.
In addition to the ongoing development of Struts 2, a Struts 1 clone surfaced in 2022, modernizing the original framework to be compatible with the latest Jakarta EE platform.
Design goals and overview
In conventional Java EE web applications, client requests are typically managed by either Java Servlets or JavaServer Pages (JSP). This often results in a blend of business logic and presentation code, which can complicate maintenance in larger projects.
Struts addresses this by enforcing a clear division between the model (business logic), view (HTML or other presentation formats), and controller (request processing). It supplies a controller servlet (ActionServlet) and supports various view technologies, most commonly JSP, but also including XML, XSLT, and Jakarta Velocity. Developers implement the model logic and define configuration mappings within struts-config.xml.
Incoming client requests correspond to "Actions" specified in the configuration file; the controller then executes appropriate Action classes that interact with the model layer. The model returns an "ActionForward" object that guides navigation to the subsequent view. Communication between model and view components relies on JavaBeans, which are accessed through a specialized tag library designed to avoid embedding Java code directly within views.
Struts adheres to a request-driven framework following the principles of Model 2.
The framework also includes support for internationalization via web forms and features "Tiles," a templating system that facilitates assembling presentation elements such as headers, footers, navigation bars, and main content areas into reusable modules.
See also
Bibliography
- James Holmes: Struts: The Complete Reference, McGraw-Hill Osborne Media,
- Bill Dudney and Jonathan Lehr: Jakarta Pitfalls, Wiley,
- Bill Siggelkow: Jakarta Struts Cookbook, O'Reilly,
- James Goodwill, Richard Hightower: Professional Jakarta Struts, Wrox Press,
- John Carnell and Rob Harrop: Pro Jakarta Struts, Second Edition, Apress,
- John Carnell, Jeff Linwood and Maciej Zawadzki: Professional Struts Applications: Building Web Sites with Struts, ObjectRelationalBridge, Lucene, and Velocity, Apress,
- Ted Husted, etc.: Struts in Action, Manning Publications Company,
- Struts View Assembly and Validation (PDF)
- Stephan Wiesner: Learning Jakarta Struts 1.2, Packt Publishing, 2005