Introduction to Struts 1.2

This course introduces the students to Jakarta Struts 1.2. During the course, students will learn to design and develop Struts based applications. Many real life hands on exercises are used to teach various concepts of Struts.

Course Outline


1. Overview of Web Applications



  • Objectives

  • Tiered Software Architecture

  • Tiered Runtime Environment

  • Tiered Architectures

  • Presentation Layer

  • Web Presentation Layer

  • Business Logic Tier

  • Tier Integration

  • Java Web Applications

  • Java Web Application Architecture

  • J2EE Architecture

  • Web Application Programming Model - MVC

  • Model View Controller

  • A Scenario of Using MVC


2. Introduction to Struts



  • Objectives

  • What is Struts?

  • Why Struts?

  • Struts Components

  • The Controller Layer

  • The View Layer

  • The Form Bean

  • A Simple Action

  • Struts Configuration

  • Define HelloAction

  • Invoking HelloAction

  • Finding Information About Struts


3. Struts Project Configuration



  • Introduction

  • Creating a Project

  • Downloading Struts Distribution

  • Struts Files

  • The web.xml File

  • Struts Configuration Basics

  • Creating Sub-modules

  • Implications of Sub-modules

  • Advanced Sub-module Issues


4. Basic Struts Programming



  • The Action Class

  • Action Life Cycle

  • The ActionServlet Class

  • The execute() Method

  • Registering an Action

  • The ActionMapping Class

  • Accessing User Input

  • Form Bean

  • Registering Form Bean

  • Form Bean Life Cycle

  • HTML Form Example

  • Accessing User Input

  • Bean Scope

  • Invoking Business Logic

  • Passing Data to Model

  • Using Separate DTO Classes

  • Controlling Page Flow

  • Redirecting the Browser


5. Basic View Development



  • Basic Form Validation

  • From Validation Pattern

  • Validation Logic

  • Validation Failure Scenario

  • Example validate() Method

  • Configure Validation

  • Error Messages

  • Show Error Messages

  • Pre-fill Form Fields

  • Basic Steps in Pre-filling

  • Example Form

  • Form Render Scenario

  • Pre-filling After Form Validation Error

  • Pre-filling an Editor Form

  • Example Form Display Action

  • Basic Input Fields


6. Struts Tag Libraries



  • Struts Tag Libraries

  • Commonality among the Struts Tags

  • HTML Tags

  • <html:form>

  • <html:submit>

  • <html:text>

  • <html:password>

  • <html:link>

  • <html:errors>

  • <html:messages>

  • <html:messages>

  • <html:multibox>

  • <html:multibox>

  • <html:select>

  • <html:options>

  • Bean Tags

  • Bean Tags

  • <bean:define>

  • <bean:define>...

  • <bean:message>

  • <bean:page>

  • <bean:include>

  • <bean:cookie>

  • <bean:resource>

  • <bean:write>

  • <bean:header>

  • <bean:parameter>

  • Logic Tags

  • Logic Tags functionality

  • <logic:equal>

  • <logic:greaterEqual> and <logic:lessEqual>

  • <logic:lessThan> and <logic:notEqual>

  • <logic:notEmpty>

  • <logic:iterate>

  • Summary


7. JSP Expression Language and Standard Tag Library



  • JSP Expression Language (EL)

  • Basic Usage

  • Built-in Objects

  • Working With Arrays and Maps

  • Operators

  • Full Example

  • JSP Standard Tag Library (JSTL)

  • Run Time Version

  • Basic Tags

  • Condition Tags

  • Interator Tags

  • Internationalization (I18N)

  • Setting Preferred Locale

  • Specifying Resource Bundle

  • Display Translated Text

  • Display Number

  • Display Date

  • JDBC Tags

  • Specify Data Source

  • Performing a Query

  • Display Result

  • Pagination Example


8. Advanced Programming



  • Error Handling

  • Application Error

  • Role of the Action

  • Role of the View

  • Show Data in Error Message

  • Declarative Exception Handling

  • Syntax of Declarative Exception Handling

  • HashMap Property

  • Array Property

  • Sub-beans

  • Dynamic Form Bean

  • Avoid JSP File Name in Links

  • Link to a Forward


9. Struts Techniques



  • Working With Check Boxes

  • The reset() Scenario

  • Example Check Box Handling

  • Dynamic List Box

  • Form Cancellation

  • Prevent Duplicate Form Submission

  • Multi-Page Flow

  • Multi-Page Flow Approaches

  • Basic Technique

  • Example Action

  • The Previous Button Handling

  • Form Validation

  • Preventing Action Proliferation

  • DispatchAction Approach

  • LookupDispatchAction Approach

  • Uploading Files

  • The FormFile Interface

  • Saving File in Database


10. The Validator Package



  • The Validator Package

  • Enable the Package

  • Validator Configuration Files

  • A sample rule in the file validator-rules.xml

  • validation.xml file

  • Basic Configuration

  • Rule Variables

  • Error Message

  • Common Validation Rules

  • Basic Validation

  • Range Check

  • Length Check

  • Special Types

  • Advanced Rules

  • Client Side Validation

  • Writing Custom Validators

  • Validator Class Example


11. Tiles Framework



  • The Problem

  • A Basic JSP Page

  • Centralized Content

  • Layout Using CSS2

  • Dreameweaver Template

  • Tiles Framework

  • Template Mechanism

  • Create the Template

  • Create Individual Pages

  • Configure Tiles

  • Composite Pages

  • Use the Pages

  • Change Management

  • Overriding Content

  • Template as a Generic Container

  • Specify the Module List

  • Render the Module List from a Template

  • Enable Tiles Framework


Audience

This course is intended for programmers and designers who want to design and develop applications using the Jakarta Struts Model-View-Controller (MVC) framework.