Course #:WA1927

Introduction to Struts 2 Using Eclipse Training

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

Struts 2 is an open source, Model-View-Controller (MVC) framework developed by The Apache Software Foundation as part of its Jakarta project. Struts 2 is built on top of JSP, Servlets, and tag libraries. Struts 2 addresses many major issues in using vanilla Servlets/JSP to build web systems. It solves the problem of controller complexity by removing the workflow logic from the Servlets and directing workflow in an XML configuration file. Struts 2 improves on the limited form support in JSP by adding numerous capabilities to form processing including easy validation, easy error display, and the refilling of form input on form retries from the user’s previous entries. It minimizes the complexity of JSP pages, by supplying a very extensive and flexible set of custom tag libraries for many of the standard operations needed in JSP pages.

Created in collaboration with several leading JEE and Struts authors and industry experts, the Mastering Struts 2.0 Developer’s Workshop is a lab-intensive, hands-on struts training course that will provide experienced Java developers with the skills required to design and build scalable, secure, maintainable web applications. This course provides students with the skills required for developing production-quality web applications, as well as hands-on exposure to advanced topics including zero configuration, testing, using Tiles to enhance the view, and design practices.

What you will Learn


Students will leave the course armed with a full set of skills to design, implement, deploy, and troubleshoot Struts 2.0 web applications. This course provides coverage of all the standard components, filters, renderers, converters, and validators, along with advice on how to use them to create solid applications. Working in a hands-on environment, students will explore and use complex user interface layouts, prototyping, and integrating templates with back-end model objects.

Working in a dynamic, interactive discussion and hands-on programming environment, developers will:

  • Understand the problems with vanilla Servlets/JSP, and the motivation for the general Struts framework
  • Understand MVC and the Struts architecture
  • Understand the lessons learned from Struts 1.x and how they influenced Struts 2.0
  • Understand the Struts FilterDispatcher, actions, and results
  • Create & configure applications using Struts 2.0 and either XML configuration files or annotations
  • Define, implement, and test ActionSupport and Action classes
  • Use Struts for form processing
  • Handle errors and debug Struts applications
  • Utilize the Struts 2.0 validation framework
  • Understand and work with the value stack to bind objects to views and request processing
  • Customize data type conversions and validation
  • Extend Struts with commonly available or custom plug-ins
  • Use Struts using annotations and smart defaults to achieve minimal or zero configuration
  • Understand how Struts 2.0 lends itself very nicely to JUnit testing
  • Work extensively with OGNL and the value stack
  • Further enhance the view portion of Struts using Tiles and the Tiles plugin
  • Trivera Technologies | Collaborative IT Education & Courseware Solutions www.triveratech.com | Info@triveratech.com | 609.647.7572
  • Mastering Struts 2.0 Developer’s Workshop
  • Examine the bigger picture of using Struts 2 constructs within various business patterns and in conjunction with JEE
  • development practices
  • Understand how maximize the leverage of the Struts 2.0 architecture

Audience

This is an intermediate level developer course, designed for experienced Java developers with some experience working with Servlets/JSPs, who need to further extend their skills in web development and Struts.

Prerequisites

Attendees should have an extensive working nowledge in developing basic Java applications.

Duration

3 Days

Outline of Introduction to Struts 2 Using Eclipse Training

Session: Getting Started with Struts 2.0

Lesson: Jakarta Struts Project

  • What is Struts?
  • About the Struts Project
  • Web Applications Defined
  • Typical User Interactions
  • Web Application Development Challenges
  • JEE and Web Applications
  • Struts Builds on JEE components
  • Benefits of Using Struts

Lesson: Review Servlets, JSPs, Filters and Web Applications

  • Dynamic Content
  • What are Servlets?
  • Where do Servlets Live?
  • Advantages of Servlets
  • Packages and Classes
  • Creating a Servlet - The Simplest Way
  • A Simple HTTP Servlet
  • Shortcomings of Servlets
  • What is a JSP?
  • A Very Simple JSP - simple.jsp
  • JSPs Look Like HTML
  • JSP Expressions
  • JSPs are Really Servlets
  • Example of the Lifecycle
  • The Generated Servlet
  • Object Buckets or Scopes
  • Using the Scopes
  • Using useBean
  • Understanding Filters
  • Filter Example
  • Web Applications
  • WAR Directory Structure
  • Web Application Descriptor – web.xml
  • Example web.xml file
  • Packaging Web Applications
  • Deploying Web Applications

Lesson: MVC and Struts

  • MVC/Model 2 Architecture
  • MVC/Model 2 Architecture - Model
  • MVC/Model 2 Architecture - View
  • MVC/Model 2 Architecture - Controller
  • Struts and MVC
  • Struts and MVC - Model
  • Struts and MVC - View
  • Struts and MVC - Controller

Lesson: What’s new in Struts 2.0

  • Shortcomings in Struts 1.x
  • Changes and enhancements in Struts 2.0
  • Struts 2.0 Benefits
  • Struts 2.0 Basic Architecture
  • Key differences from Struts 1
  • Lesson: Struts 2 Architecture
  • Overview of the Struts 2.0 Architecture
  • Request Processing Flow
  • Request Processing Flow – One View
  • Request Processing Flow – Another View
  • Key components
  • Configuration files

Lesson: Struts 2 Components Overview

  • Struts 2.0 Basic Architecture
  • FilterDispatcher
  • Struts 2.0 Basic Architecture
  • Action objects
  • Struts 2.0 Basic Architecture
  • Results
  • Struts 2.0 Basic Architecture
  • Interceptors

Session: Your First Struts Application

Lesson: Creating the Application

  • Creating a Web Project (manually)
  • Creating a Web Project (IDE)
  • Creating a Web Project (Maven)
  • Web Project Structure
  • Web Project Structure Example
  • Web Project Structure - Maven

Lesson: Configuring web.xml

  • web.xml Overview
  • web.xml – Struts information
  • Lesson: Configuring Struts.xml
  • Configuring Struts.xml
  • Administrative Elements
  • Request Handling Elements
  • Error handling Elements

Lesson: Implementing Actions

  • Creating Action classes
  • A simple Action Class
  • Another Simple Action Class

Lesson: Adding Basic View Components

  • View Components
  • A Simple View Component
  • Configuring the View Component

Session: Mapping the Model to the View

Lesson: Review: Using Custom Tags

  • JSP Limitations?
  • Sun’s Solution - Custom Tags
  • Custom Tags
  • Custom Tag Capabilities
  • Custom Tag Overview
  • Tag Libraries
  • Tag Library Descriptor (TLD)
  • Tag Libraries and JSPs
  • Summary of Using Custom Tags

Lesson: Introducing Struts 2 Tags

  • The Struts 2 Tag Library
  • The Value Stack
  • Tag Syntax
  • Tag Reference
  • Tag Reference – Generic Tags
  • Tag Reference – UI Tags
  • FreeMarker and Velocity
  • FreeMarker Tags
  • Velocity Tags

Lesson: Themes and Templates

  • Overview of Templates and Themes
  • Template Example
  • The simple Theme
  • The Default (xhtml) Theme
  • The ajax Theme

Session: Validation and Type Conversion

Lesson: XWorks Validation Framework

  • Validation Techniques
  • XWork2 Validation
  • Built-in Validators
  • Built-in Field Validators - visitor
  • Built-in Field Validators - conversion
  • Specifying Validation
  • Lesson: Implementing Validation
  • Basic Validation
  • Basic Validation – the Form
  • Basic Validation – the Validation Descriptor
  • Custom Validators

Lesson: Type Conversion

  • Type Conversion Basics
  • Type conversion tips
  • Custom Converters
  • Custom Converter Example

Session: Localization and I18n

Lesson: Locales and Internationalization

  • Significant Issues for Localization
  • Localization in Struts 2
  • Locales
  • Lesson: Resource Bundles
  • ResourceBundle
  • Resource Bundle Naming
  • Message Types in the Bundle
  • Specifying the Resource Bundle

Lesson: Formatting Messages

  • Tags with Locale Support: UI tags
  • Tags with Locale Support: Messages
  • Tags with Locale Support: date

Session: Putting It All Together

Lesson: Understanding the Design

  • Creating TriveraTunes
  • TriveraTunes Flow
  • Searching CD’s: The Request
  • Searching CD’s: Displaying The Results
  • Choosing what to do next
  • Editing the Details
  • Showing Error Messages
  • Handling Exception
  • Database Access
  • Database Access – A Technical Use Case
  • Database Access – the Service Interface
  • Database Access – Service Options
  • DAO Overview
  • DAO Benefits
We regularly offer classes in these and other cities. Atlanta, Austin, Baltimore, Calgary, Chicago, Cleveland, Dallas, Denver, Detroit, Houston, Jacksonville, Miami, Montreal, New York City, Orlando, Ottawa, Philadelphia, Phoenix, Pittsburgh, Seattle, Toronto, Vancouver, Washington DC.