Summary
5 days
This advanced 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.3.8 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.
Prerequisites
This course is intended for Java Programmers who are familiar with JSP and Servlets, and have basic knowledge of XML. Module 1: Introduction to J2EE Architecture
- What is J2EE
- J2EE APIs
- MVC
- Benefits of J2EE
Module 2: Struts Architecture
- Overview
- The Struts Mechanizm
- Basic Struts
- Example: ActionForm
- Action
- Example: Action Class
- ActionForward
- ActionMapping
- JSP
- struts-config.xml
- web.xml
- Exercise
Module 3: Simple Validation
- Processing Simple Validation
- Anatomy of ActionForm
- Validate Method
- Example
- Index.jsp
- Result.jsp
- Quiz
- Summary
- Exercise
Module 4 : Processing Business Logic
- Overview
- The Statelessness of Action
- Subclassing Action
- Complex Validation
- Navigation
- Exercise
Module 5: JDBC
- Overview of JDBC
- Connecting to the DataBase
- Submitting the SQL statements
- Retrieving and processing data
- DB_Action Class
- Data Access Object
- Exercise
Module 6: Custom Tags
- Overview of Custom Tags
- Create You Own Tags
- The Tag handler Class
- The TLD File
- Deploying JSP with Custom Tags
- Exercise
Module 7: Struts Tags
- Basic Tags
- Page Processing Lifecycle
- Evaluation, Replacement, and Sending
- Bean Tags
- bean:message
- bean:define
- bean:page
- bean:resource
- HTML Tags
- html:form
- html:text
- html:checkbox
- html:errors
- Exercise
Module 8: The struts-config.xml
- The Structure of struts-config.xml
- Declaring Form Beans
- Global Exceptions
- Example
- Global Forwards
- Declaring Action Classes
- Message Resources
- Exercise
Module 9: The Logic Tag Library
- Overview
- Three Part of Logic Library
- Iteration
- Example
- Exercise
- Conditional Processing
- logic:empty
- logic:equal
- Flow of Control
- Exercise
Module 10: Standard Tag Library
- Overview
- Expression Language
- Accessing Data
- The Dot Operator
- Accessing Collections
- The Core JSTL Tags
- Exercise
Module 11: The Struts Validator Framework
- Overview
- Using Validator Framework
- Add The Validator Plug-in
- XML Files
- Copy The Validator Rules
- Copy The Error Messages
- Setup Form Beans
- Defined Validation Rules
- validations.xml
- Example
- Standard Built In Validations
- Designing Complex Validations with validwhen
- Exercise
Module 12: Dynamic Forms
- Overview
- Adding DynaActionForm Entry
- Creating Action Class
- Action Mapping
- Creating a JSP
- Example
- Exercise
Module 13: Tiles
- Overview
- Tiles in Struts-based Applications
- Tiles Framework
- Tiles for Layout
- Create a Tile Layout
- Develop Web Pages Using Layout
- Layout JSP
- Example
- The Tags under <tiles>
- Exercise
Module 14: Hibernate
- Overview
- Hibernate
- Architecture Of Hibernate
- Code Example
- Creating Persistent Java Objects
- Mapping Persistent Object
- Hibernate Configuration File
- Inserting new record
- Querying the database
- Example
- Exercise
Module 15: Internationalization
- Property Files
- Localization
- Example
Module 16: Struts or JSF?
- What is JavaServer Faces?
- Main Components
- Benefits of JSF
- What is JSF Application?
- Why JSF?
- Struts and JSF
Module 17: JSF Architecture
- Physical Components
- How Does JSF Work?
- The FacesServlet
- The Lifecycle Object
- Reconstitute Component Tree
- Apply Request Values
- Process Validation
- Update Model Values
- Invoke Application
- Render Response
Appendix:
- Struts
- Create a Connection to a Database
- Create a Table
- Simple JSP
- Custom Tags
- JSTL
|