Ajax Training: Ajax for Java Developers
EJB Training: Introduction to Enterprise Java Beans
Groovy for Java Developers
Hibernate Training
Intermediate Java Training
Introduction to Java Programming Training
Introduction to XML Training
Jakarta Struts Training
Java Development for Secure Systems
Java EE 5 (JEE - including EJB3)
Java Programming with Eclipse
JavaServer Faces (JSF) : Using JSF to Build J2EE Web Apps on the JBoss Application Server
JavaServer Faces Training: Introduction to JSF Training
JavaServer Pages Training: Introduction to JSP and Servlets Training
JBoss Training: Administering the JBoss 4.x Application Server
JBoss Training: Administering the JBoss® 5.X Application Server
JBoss Training: Enterprise JavaBeans (EJB 3) on the JBoss Application Server
JBoss Training: Enterprise JavaBeans 3.0 (EJB3) and the Java Persistence API (JPA) on the JBoss Application Server
JBoss Training: Java EE with Servlets JSP & JDBC on JBoss AS
JBoss Training: Servlets/JSP on the JBoss Application Server
JBoss Training: SOA and Java Web Services (JAX-WS) on the JBoss Application Server
Patterns In Frameworks Workshop
Software Design Training: Effective Software Development Training Boot Camp
Spring Framework Training (Spring 3)
Test Driven Development (TDD) for Java
The JSP Standard Tag Library (JSTL)
Web Development Using Grails Training
Web Services Training: Developing Java Web Services
XML Programming Using Java
    

Jakarta Struts Training

This course can be taught in WSAD, RAD, Eclipse, NetBeans, JBoss and other IDE's.
  Course #:  NT230
  Duration:  5 days

Struts Training Overview

nTier's Jakarta Struts training course shows JSP and servlet programmers how to build "Model-2" Web applications using the Jakarta Struts project from Apache. Students learn the Struts architecture and see how it captures a great deal of pre-existing best practice in Web application development. They build applications from scratch using the Struts 1.1 code base, advancing through actions and action mappings, form beans, and request forwarding. They use relational data at the model layer and learn to configure JDBC data sources under Struts. Throughout, the course emphasizes the great facility in Struts of using XML declarations to replace boilerplate Java coding. The course then shifts from these controller techniques to a focus on presentation. Students learn to use various libraries of custom JSP tags: the JSP Standard Tag Library (which supersedes a number of Struts tags), Struts HTML tags for form-building and validation, and the Tiles library for robust and reusable page layouts. Two chapters near the end of the course treat issues of effective Struts development: one focuses on "under the hood" coding techniques and one on best practices at a design level. By the end of the course, students are building complex, internationalized Web applications that validate user input, handle error conditions gracefully, and make best use and reuse of control and presentation logic through actions, form beans, validators, business and persistence JavaBeans, and Tiles.

The course software also includes an optional overlay of workspace and project files to support use of the Eclipse IDE in the classroom. (This requires that the instructor be experienced in use of Eclipse and able to walk students through basic tasks in the IDE.)

Struts Training Learning Objectives

  • Understand and implement MVC
  • Use Struts actions and action mappings to take control of HTTP requests/responses.
  • Manage HTML form input and output with form beans, and use these beans to simplify data handling in the controller.
  • Use persistent data in a Struts application with JDBC.
  • Use JSTL and Struts custom tags to build robust and reusable JSP presentation logic.
  • Support multiple client locales with various internationalization techniques.
  • Define validation rules for input forms, and provide clear user feedback.
  • Build complex presentations using decoupled, reusable tiles, screens and layouts.

Struts Training Prerequisites

Java programming experience is required; we're happy to help you assess your team's skills as preparation for this course. Students should be comfortable with HTML, JSP, Servlets and basic XML.

Struts Training Outline

  1. Struts Architecture MVC and Model 2
    • Command Pattern
    • Jakarta Struts
    • More XML, Less Java!
    • Action Mappings
    • JavaBeans in Struts
    • Working with Forms
    • Validation
    • Relational Models Presentation
    • Technology Tiles
  2. Action Mappings
    • Command Pattern for Web Applications
    • ActionServlet Action
    • ActionMapping
    • Struts Configuration
    • Selecting a Forward
    • Global Forwards
    • Forwarding Actions
    • Other Action
    • Subtypes
    • Declarative Exception Handling
  3. Forms
    • Working with HTML Forms
    • What Not To Do
    • Action Forms
    • Relationship to Input
    • Relationship to Actions
    • Relationship to the Model
    • Relationship to Output
    • DynaActionForm and Map-Backed Forms
    • Validation
    • Coarse-Grained Form Beans
  4. Relational Data
    • JDBC Drivers
    • DriverManager (JDBC 1.0)
    • DataSource (JDBC 2.0)
    • Connection Statement
    • ResultSet
    • The Struts Data-Source Manager
    • Multi-Tier Design
    • Business Logic Beans
    • Persistence Logic EJB
  5. Struts Tag Libraries
    • Building View Components
    • Struts Tag Libraries Attributes
    • Building Forms et. al.
    • Forms and Form Beans
    • Scope and Duration of Form Data
    • Managing Hyperlinks Error Messages
    • Logic Tags
  6. The JSP Standard Tag Library
    • JSTL Overview
    • JSP Expression Language
    • Core Tags
    • Formatting Tags
    • XML Tags
    • SQL Tags
    • Mixing JSTL, EL, Scripts and Actions 
  7. Internationalization and Localization
    • i18n in Java
    • Locale ResourceBundle
    • i18n in Actions
    • i18n in JSTL
    • i18n in Validation
  8. Input Validation
    • Validation in Web Applications
    • Validation in Struts
    • The Struts Validator Plug-In
    • Validating ActionForm Subtypes
    • Configuring Validation
    • Validators
    • Rules
    • Is Necessary?
    • Reporting Errors
    • Multi-Page Validation
    • Client-Side Validation
    • Limitations on the Client Side
    • Implementing a Validator
    • Implementing ActionForm.validate
  9. Under the Hood
    • Global Objects and Keys
    • Modules
    • ActionServlet, RequestProcessor, ExceptionHandler
    • Struts Configuration in Depth
    • The org.apache.struts.config Package
    • Plug-Ins
    • Logging with Commons and Log4J
    • Configuring Log4J
    • Logging in Web Applications
    • The org.apache.struts.util Package
    • Commons BeanUtils
  10. Best Practices
    • Cardinalities in Struts Design
    • Coarse-Grained Form Beans
    • Many Actions from One View
    • Multiple Forwards
    • Many Mappings to One Action
    • Chaining Actions
    • Dynamic Forwarding
    • Form Beans as Mediators
    • Using Reflection and BeanUtils
    • Reusing Validation Rules
    • Mapping-Based Validation
    • Graceful Validation
  11. Tiles
    • Consistent Look and Feel
    • Reusable Layouts and Content
    • The Tiles Framework
    • Instantiating Layouts
    • Body-Wrap
    • Insertions
    • Tiles and Stylesheets
    • Working with Tiles
    • Attributes
    • The Tiles Context
    • Definitions
    • Aggregation and Inheritance
    • The Tiles Plug-In
    • Forwarding to Definitions
    • Performance Considerations

Appendix A.  Learning Resources

System Requirements
Hardware – minimal: Pentium 500MHz, 128 meg RAM, 500 meg HD.
Hardware – recommended:   Pentium 1.5gHz, 512 meg RAM, 1 gig HD.
Operating system:

Tested on Windows XP Professional. The course software should be viable on all Windows or Linux systems which support J2EE 1.4.