Struts 2 - Framework Overview

(Web Tutorial)

by Michael Thomas

Struts Home Page

In this tutorial an overview of the Struts 2 Framework will be discussed.
Note: On the "Struts Home Page", you can download the whole site (all content, tutorials & examples) !!!

This tutorial covers: Struts 2

Prerequisites

Objectives

Struts 2 Architecture

The Struts official web site says:  "Apache Struts is a free open-source framework for creating Java web applications. ... The Struts framework is designed to help developers create web applications that utilize a MVC architecture." (http://struts.apache.org)

Apache Struts 2 - Quote from Struts Docs (after install: docs\index.html)

"Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time." (Struts Docs)

"Apache Struts 2 was originally known as WebWork 2. After working independently for several years, the WebWork and Struts communities joined forces to create Struts2. This new version of Struts is simpler to use and closer to how Struts was always meant to be." (Struts Docs)   

MVC (Model-VIew-Controller) is an software development architecture pattern.

The MVC (Model-VIew-Controller) architecture separates software applications into 3 concerns (layers):

MVC advocates believe it is easier to create and maintain larger applications when the above concerns are separated.  Development, testing and maintenance of code can be separated in to the 3 concerns allowing multiple skill sets to be used (Model-Java & DB, View-Struts2).  Modules can be rearranged easier based on actions in the Controller layer.

Old JSP (Java Server Pages) Framework: JSP Model 1 - framework which was JSP page controlled.

New JSP Framework: JSP Model 2 (MVC) - page designers can work in the View layer while Java developers can work in the Controller & Model layers.

Struts Implementation of MVC

Terminology

Struts Guidlines (Rules)

Struts 1 vs Struts 2

...

Struts History

Resources