Building JEE Web Applications Using Struts

Duration: 2 days
Type: intermediate

Description

This course enables JEE Web Application developers to incorporate the Struts Framework into their designs. All aspects of Struts development are covered including the core architecture, error handling, validation and Tiles.

This is a workshop based course with delegates spending the majority of their time implementing new web applications and enhancing existing ones.

Prerequisites

Delegates attending this workshop should be competent Java programmers with a good understand of standard Web Application development using JSP's and Servlets

List of Modules

Review of J2EE Web Application Design

The lifecycle of a Java Servlet
The lifecycle of a Java Server Page
Creating and deploying Web Archives
Request dispatching and state management
Using JSP 2.0 Expression Language
The Model2 design for Web Applications

The Struts MVC Architecture

The ActionServlet Front Controller
The RequestProcessor Application Controller
Control components and the Action class
Model components and the ActionForm class
View components and the Tag Libraries
The Struts deployment descriptor

The Struts Tag Libraries

Using HTML Tags to build a client view
Encapsulating conditionals and iteration using the Logic Tag Library
Creating and manipulating JavaBeans using the Beans Tag Library
Nesting the Struts JSP Tags
Overlap between Struts and the JSTL
Integrating the JSTL using Struts EL

Creating a Struts Based Application

Configuring the ActionServlet in web.xml
Creating a Struts deployment descriptor
Coding Action and ActionForm classes
Writing the input and output JSP's
Deploying and testing the application
Introducing Dynamic ActionForms

Exception Handling in Struts

Default exception handling behavior
Declaring global exception handlers
Declaring local exception handlers
Using ActionMessage objects
Adding errors in Action classes
Presenting error information in JSP pages
Storing error text in resource bundles

Advanced Struts Development

Mapping multiple requests to a single controller using DispatchAction
Mapping multiple URL's to a single controller using MappingDispatchAction
Pre-built actions for request dispatching
Using Dynamic Action Forms to avoid manually creating ActionForm classes
Creating Struts plug-in components
Customizing Struts by extending the RequestProcessor class

Using Tiles to Create Template Views

Introducing template based layouts
Using the Tiles Framework with Struts
Creating a Tile based layout
Inserting content into a layout

The Struts Validator

The history of the Validator project
Using the Validator with Struts
Configuring validation-rules.xml
Configuring validation.xml
Using validation in ActionForms
Adding new validation rules

Possible Successors to Struts

The JavaServer Faces (JSF) Architecture
WebWork and the Struts 2 framework
Spring MVC and WebFlow