Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Apache Struts 2 Architecture in a Nutshell

Image Modified

  1. The web browser requests the page
  2. The Filter Dispatcher looks at the request and determines the appropriate Action<
  3. The Interceptors automatically apply common functionality to the request like workflow, validation, and file upload handling
  4. The Action method executes, usually storing and/or retrieving information from a database
  5. The Result renders the output, be it HTML, images, or PDF, to the browser

Struts Tags in a nutshell

...

A web application uses a deployment descriptor to initialize resources like filters and listeners. The web deployment descriptor is formatted as a XML document and named web.xml. Likewise, the framework uses a configuration file, named struts.xml, to initialize its own resources. These resources include action mappings, to direct input to server-side Action classes, and result types, to select output pages.

...

(lightbulb) The framework provides general-purpose defaults, so you can start using Struts right away, "out of the box". As needed, you can override any of our defaults in your application's configuration.

Struts

...

MVC in a Nutshell

...

Struts is a Model View Controller framework. Struts provides Controller and View components, and integrates with other technologies to provide the Model. The framework's Controller acts as a bridge between the application's Model and the web View.

...

Is Struts the best choice for every project?

NoApache Struts 2 helps you create an extensible development environment for enterprise-grade applications, based on industry standards and proven design patterns. If you need to write a very simple application, with a handful of pages, then you might consider a "Model 1" solution that uses only server pages.

...