Jump to content

Apache Struts 1

From Alfawiki
Apache Struts
Company typeOpen source software
IndustrySoftware framework
FoundedMay 2000; 26 years ago (2000-05)
FounderCraig McClanahan
Headquarters
Global
ProductsJava EE web application framework
OwnerApache Software Foundation
Websitestruts.apache.org

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

External links