Apache Struts 2
Struts 2 is a web-based MVC framework that emphasizes simplicity and interoperability. The framework is designed so that you can use as many or as few of its features as you like.
Struts 2 is at a pre-release, pre-Alpha stage. If you are just getting started with Struts2/WebWork2, we recommend WebWork 2.2 as an entry point. WW2 is stable and production ready. When Struts 2 is released, migration paths for WebWork 2 and Struts 1 developers will be available.
See the Struts 2 release plan for details and status.
In a conventional web application, requests are often routed to a server page. The server page is responsible for all the processing required by the request.
In a Stuts 2 application, the request first goes to a dispatcher component that selects an action. The action can include an Action class, several Result classes, and even exception handling. The action can also include a set of "interceptors" that are used to apply common concerns to similar requests.
The Action class processes the logic, and selects a Result class. The Result class can either render the response directly or (more often) transfer control to a server page or template page.
To make it easier to access dynamic data obtained by an Action, the framework includes a library of custom tags. The tags interact with the framework's validation and internationalization features, to ensure that input is correct and output is localized. The tag library can be used with JavaServer Pages or FreeMarker templates.
The online documentation is grouped into three areas.
Our overview is your ten minute tour of Struts 2: Who, What, When, Where, and Why.
is an elegant, extensible framework for building enterprise-ready Java web applications. Distributions of Struts 2 are available as a free download under the Apache License.
- For more about the Apache Struts project itself, visit the project web site.
- Quickstart with Struts 2 Maven Archetypes.
- Struts 2 is extended using Plugins. A list of available plugins is available at the Struts 2 Plugin Registry.
- Tired of XML-based configurations, or need some extra agility? Try the Convention Plugin or its RESTful cousin, the REST Plugin.
- Interested in books, articles, and presentations about Struts? Check out some Other Resources.
- For other community-supported Struts resources, visit the Struts 2 Wiki.
The contents of the Struts 2 documentation wiki (what you're reading now) are distributed with each release, but maintained via the on-line wiki.
We've started planning the next version of Struts aka Struts 3 (or 2.5) which will break backward compatibility, if you want to join please add your two cents here.
The documentation is grouped into four areas.
Our tutorials are designed to help you get started with the framework soon as possibleASAP. We offer an all-purpose "soup to nutsBootstrap" tutorial as well as specialty tutorials on portlets and database access.
Our in-depth technical guides focus on specific areas components of the framework, such as Views, Third-party Extensions, and the Core framework.
the Core framework, Struts Tags, and optional Extensions, as well as migrating from Struts 1 or WebWork 2.
Our FAQs and Cookbook examples provide a wide range of rapid-fire "HOWTOs" in question-and-answer format.
Our security bulletins explain any security issues and their solutions
Books, articles, and presentations about Struts 2.
Help with WebWork2
The Struts 2 Community Wiki is an additional resource. It is not distributed with Struts 2, and contributions to the community wiki do not require a CLA.