Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: correct link and remove dead link

...

Apache Struts 2

...

Apache Struts 2 is a flexible control layer based on standard technologies like Java Filters, JavaBeans, ResourceBundles, Locales, and XML, as well as various OpenSymphony packages, like OGNL and XWork. The framework helps you create an extensible development environment for your application, based on industry standards and proven design patterns.

Warning
titleWork in progress!

Apache 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.

Apache Struts 2 in a Nutshell

The framework provides its own web Controller component and integrates with other technologies to provide the Model and the View. For the Model, the framework can interact with standard data access technologies, like JDBC and EJB, as well as most any third-party packages, like Cayenne, Hibernate, or iBATIS. For the View, the framework works well with JavaServer Pages, including JSTL and JSF, as well as FreeMarker or Velocity Templates, PDF, XSLT, and other presentation systems.

The framework's Controller acts as a bridge between the application's Model and the web View. When a request is received, the Controller invokes an Action class. The Action class consults with the Model (or, preferably, a Facade representing your Model) to examine or update the application's state. To transfer data between the Model and the View, properties can be placed on the Action class, or on a plain old JavaBean.

Most often, the Model is represented as a graph of JavaBean objects. Preferably, the Model will do the "heavy lifting", and the Action will act as a "traffic cop" or adapter. The framework provides sophisticated, automatic type conversion to simplify transfering data between rich domain objects and text-only HTTP requests.

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 JSP, FreeMarker, or Velocity.

Getting Started

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.

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.

Tip

Have a suggestion, correction, or improvement? Log in and leave a comment on the appropriate page or file a ticket against the Struts 2 documentation. We're always looking for help!

Note

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.

Getting Started

The documentation is grouped into four The online documentation is grouped into three areas.

Tutorials

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.

Guides

Our in-depth technical guides focus on specific components of the framework, such as the Core framework, Struts Tags, and optional Extensions, as well as migrating from Struts 1 or WebWork 2.

FAQs and Cookbook

Our FAQs and Cookbook examples provide a wide range of rapid-fire "HOWTOs" in question-and-answer format.

Guides

Our in-depth guides focus on specific components of the framework, such as Views, the Core framework, and Third-party Extensions.

Tutorials

...

Security Bulletins

Our security bulletins explain any security issues and their solutions

(star) Other Resources

Books, articles, and presentations about Struts 2.

Excerpt Include
Nutshell
Nutshell

...

nopaneltrue

FAQS

...

Community Wiki

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.

Next: Tutorials

...

Guides

...