The Struts framework is a highly productive environment that employs many best practices and stops the constant re-invention of basic wheels in Java JSP/Servlet Web Development. Form Validation, repopulation, internationalization, custom tags, and heavy use of MVC principles are just some of the basic components used in this exceptionally popular framework.
Prerequisites:
Intermediate Java 2 for Enterprise Programmers or equivalent experience with:
Servlets
Java Server Pages
Cookies, Form Processing and Session Management
Java Beans
JDBC and DAO
Objectives:
Understand the traps and problems common to most JSP/Servlet developers and how Struts addresses them
Understanding how Struts implements MVC
Using Struts Controller, View, and resource bundle components
Using FormBeans and Struts Validation
Using DynaActionForms
Using Struts Configuration and ActionMappings
Handling Errors
Using the Struts Custom Tag Library
Audience:
Experienced JSP/Servlet Web Developers looking to become more productive
Outline:
Module 1: Getting Started with Struts
Jakarta Struts Project
MVC and Struts
Review of Servlets, JSP, and Web Applications
Struts Controller, Views, and Resources
Building your projects with XDoclet and Ant (optional)
Module 2: Your First Strust Application
Configuriing Struts Applications
Defining Views and Actions
Defining FormBeans
ActionMappings
Module 3: Uploading Files and Internationalization (I18N)
Uploading Files
Internationalization
Locales
Property Resource Bundles
Formatting Messages
Message Resources
Module 4: Validation, Errors, and Debugging Struts Applications
Adding Error Handling
ActionError and ActionErrors
ActionForm validate method
Error Management in Action.execute( )
Setting up the Debug environment (debugging and logging)
Handling Exceptions
Module 5: Bean, Logic, and HTML Custom Tags
Cookie Management
Defining Beans
Working with Headers
Working with Beans
Handling Message Resources
Working with HTML Forms and Form Beans
Iterating over lists and sublists
Conditionally including parts of your JSP
Using JSTL in place of the Struts Custom Tags
Module 6: Putting it all together and Best Practices
Building a nested Add/Edit/Delete Listing (CRUD)
Nested Listings
Action Forwarding to Actions
Pre-populating ActionForms for editing
Implementing a multi-step process
Best Practices
Module 7: Working with the Tiles Custom Library
Defining Templates
Using get, put, and insert
Defining JSP definitions
Defining XML definintions
Advanced Tile Features
Understanding Tile Scope and variables
Module 8: Advanced Form Management
Working with DynaActionForms
Setting up the Validator
Struts Validator: Email, mask, range, length, date, and credit card validation
Validator and Dynamic Forms
Validator and Static Forms