EIEIOTECHNOVATION
← Training programmes

EIEIO / AUTOMATION & EMERGING TECHNOLOGY

Struts 1 vs Struts 2

Course outline

5 days

Duration

5 days

Course Outline

Apache Struts is a free, open-source, MVC framework for creating elegant, modern Java web applications. It favors convention over configuration, is extensible using a plugin architecture, and ships with plugins to support REST, AJAX and JSON.

Struts 1.x is a complete web framework, provides complete web form components, validator, internalization, error handling, tiles layout, low learning curve and easy to implement it.

Apache Struts 2, another popular Java Model-View-Contraller (MVC) framework, combine of both successful WebWork and Struts 1.x web frameworks.

Apache Struts 2, is totally different with Struts 1, its core features are all implemented with interceptors, “value stack” concept, OGNL expression and Struts 2 tags to work around the application data, and many annotations and conventions to make this framework more simpler to use.

Course Content

Struts 1

Chapter 1 – Struts Quick Start

  • Introduction to Apache Struts
  • Struts Hello World example

Chapter 2 – Struts Configuration

  • Configure the Struts Tag Libraries
  • Configure a welcome page in Struts
  • Multiple Struts configuration files
  • Struts configuration files in wildcards support

Chapter 3 – Struts Action and ActionForm

  • ForwardAction
  • DispatchAction
  • MappingDispatchAction
  • DynaActionForm

Chapter 4 – Struts Web Form Components

  • TextBox
  • Hidden value
  • Radio option
  • Drop down
  • Check box
  • File upload
  • TextArea
  • Rewrite

Chapter 5 – Struts Logic Tags

  • Struts tag to iterate over collections
  • Struts tag to check specified property is null or zero-length String.
  • Struts tag to check specified property is equal to a given value.
  • Struts conditional tag for comparing numbers.
  • Struts tag to check the specified property contains the given value as substring.
  • Struts tag to check the specified message or error message exists on the current request.
  • Struts tag to check the specified given object or property is exists in the current request.

Chapter 6 – Struts Error and Logging

  • Struts <global-exception> to display the custom error page to user.
  • Integrate Struts with Log4j logging framework to log the system exceptions and errors.
  • Handling classic 404 error page in Struts.

Chapter 7 – Struts Misc

  • Struts Localization
  • Struts Validator Framework
  • Struts Tiles Framework

Struts 2

Chapter 8 – Struts 2 Quick Start

  • Struts 2 hello world example with XML file.
  • Struts 2 hello world example with annotation.
  • @ResultPath annotation explanation and example.

Chapter 9 – Struts 2 Configurations

  • Multiple Struts configuration files example
  • Namespace configuration example and explanation
  • Struts 2 Development mode
  • How to remove the action suffix extension in Struts 2

Chapter 10 – Struts 2 Action and Form

  • Working with Struts 2 actions
  • Struts 2 ActionError & ActionMessage Example
  • Struts 2 ModelDriven example

Chapter 11 – Struts 2 Interceptors

  • Mapping interceptors to action
  • Override the interceptor parameters
  • Interceptor stack example
  • Creating own interceptor
  • execAndWait interceptor example

Chapter 12 – Struts 2 Tags

  • Struts 2 UI Tags
  • Struts 2 Control tags
  • Struts 2 Data Tags

Chapter 13 – Struts 2 Misc

  • Struts 2 Theme

Programme scope, delivery arrangements and suitability are confirmed during enquiry.