Struts 2 Java Web Development

Apache Struts 2 is an extensive and elegant framework that makes it easier to create, deploy, and maintain web applications for the Java Enterprise Edition platform. This course describes the architectural concepts that underpin Struts 2, and explores the framework in detail. The course also shows how Struts 2 integrates with companion technologies, including Ajax and the Spring Framework.


3 days



  • At least 6 months Java programming experience

What you'll learn

  • Creating Web applications using Struts
  • Implementing MVC architectures using Struts
  • Performing data validation and conversion
  • Implementing state management
  • Defining responsive UIs with Ajax
  • Integrating Struts with other frameworks

Course details

Introduction to Struts 2

  • The Apache Struts program
  • Action-based framework concepts
  • The role of Struts 2 in contemporary Java Web development
  • Key components in a Struts 2 application

Creating a Struts 2 Web application

  • Preparing the development environment
  • Configuring Struts 2 actions, results, and interceptors
  • Linking the flow by configurations
  • Building dependencies with Inversion of Control (IoC)

Implementing Struts 2 actions

  • Using the ActionSupport base class
  • Using ModelDriven actions
  • Unit testing actions
  • Localizing messages

Gathering and validating user input

  • Using Struts 2 tags
  • Using on-demand data access
  • Controlling page flow with model data
  • Validating user input
  • Configuring validation

Defining interceptors

  • The role of interceptors
  • Working with the default interceptor stack
  • Customizing request processing
  • Implementing application-specific interceptors

Storing application state

  • The need for application state
  • Strategies for storing application state

Generating dynamic views

  • Selecting output pages
  • Combining multiple actions into a sequence
  • Presentation technology alternatives
  • Defining wizard-style Web applications

Advanced user interface techniques

  • Using Struts 2 presentation tags
  • Defining templates
  • Using Struts 2 themes

Creating responsive user interfaces with Ajax

  • Overview of Ajax and Web 2.0 concepts
  • Creating Ajaxified applications in Struts 2
  • Handling asynchronous requests with Ajax
  • Returning JSON and XML data

Integrating Struts 2 with alternative frameworks

  • Integrating Struts 2 with Java Enterprise Edition and the Spring Framework
  • Syndicating web content created using RSS and REST