Jakarta-Struts Live

Peter Kitson

ISBN : 0974884308

Order a printed copy of this book from Amazon.


Cover Design - Jakarta-Struts Live
 

For your free electronic copy of this book please verify the numbers below. 

(We need to do this to make sure you're a person and not a malicious script)

Numbers

 




Sample Chapter From Jakarta-Struts Live
     Copyright © Rick Hightower



Introduction


The book is a step-by-step guide to using Struts with best practices and enough theory to get you using and
understanding the technology on your web applications. The focus of the book is to provide examples and stepby-
step guides, not a rehash of the online documents.

Chapter 1: Struts Tutorial Step-by-step covers getting started with Struts—just the facts to getting started with
Struts ASAP. In one chapter you will learn about the struts configuration, writing Actions, working with Struts
Custom tags, setting up datasource, handling exceptions, and displaying objects in a JSP in enough detail for you
to get started with each. In this chapter you will perform the following steps: download Struts, setup a J2EE web
application project that uses Struts, write your first Action, write your first “forward”, configure the Action and
forward in the Struts configuration file, run and Test your first Struts application and more. This chapter also
covers an important topic for newbies and Struts veterans alike, namely, debugging struts-config.xml, and logging
support for debugging and understanding your Struts web application at runtime.

Chapter 2: Testing Struts covers test-driven-development with Struts. This chapter lays the groundwork with
JUnit then covers StrutsTestCase and jWebUnit. You will use JUnit to test your model code. You will use StrutsTestCase
to test your controller Actions. And, you will use jWebUnit to test your view and presentation logic.
This chapter lays the groundwork for TDD. Chapter 9 picks up the torch on TDD.

Chapter 3: Working with ActionForms and DynaActionForms is divided into two sections. The first section
covers mostly theory and concepts behind ActionForms. The second part covers common tasks that you will
need to do with ActionForms like: ActionForms that implement a master detail, ActionForms with nested Java-
Bean properties, ActionForms with nested indexed JavaBean properties, ActionForms with mapped backed
properties, loading form data in an ActionForm to display, working with wizards-style ActionForms, configuring
DynaActionForms and more. All of the concepts introduced are backed up with examples, and step-by-step
guides.

Chapter 4: Working with the Validator Framework covers understanding how the Validator Framework integrates
with Struts and using the Validator Framework with static ActionForms and with DynaActionForms. The
chapter includes step-by-step guides to working with common validation rules. Then it continues by demonstrating
building and using your own configurable validation rules. There are some special considerations when using
the Validator framework with Wizard; thus this chapter covers in detail working with wizards and Validator
framework by employing the page attribute. It also covers the common technique of using the Validator Framework
and your own custom validation at the same time. In addition the chapter covers employing JavaScript validation
on the client side.

Chapter 5: Working with Actions covers all of the standard actions and the helper methods of the action class
as well as advanced action mapping configurations.

Chapter 6: MVC for Smarties covers background and theory of MVC as it applies to Struts. Java promotes
object-oriented programming, but does not enforce it, i.e., you can create non OO code in Java. Similarly, Struts
promotes MVC / Model 2 architecture, but does not enforce it. To get the best out of Struts, you need to know
MVC / Model 2. This chapter covers the basic rules and guidelines of MVC so you can get the most out of Struts.

Chapter 7: Working with Struts tags covers JSP custom tag fundamentals and using the standard Struts tags
(html, logic and bean). This chapter is not a rehash of the documents. There are a lot of examples.

Chapter 8: JSTL and Struts EL covers combining JSP Standard Tag Library (JSTL) and Struts. Struts pushed
JSP custom tags to the limit. JSTL extends many of the concepts found in Struts Logic Tags. In many ways,
JSTL is the natural successor to the Struts tag libraries. You may wonder why we mention JSTL in a book on
Struts. Simply, JSTL tags take the place of many Struts tags, and are easier to use. It is the recommendation of
the Struts Development team that you should use JSTL tags in place of Struts tags when there is an overlap. In
addition, many of the Struts standard tags have been updated to use JSTL EL. Thus, this chapter covers Struts-EL
as well.

Chapter 9: Ignite your Struts web application development with AppFuse covers developing a real world
web application. AppFuse is a starter web application that has a starter project that includes support for Object/
Relation mapping, J2EE security, database testing, enforcing MVC with best practices, and common design patterns.
It includes support for Hibernate, Canoo, DBUnit, and much more.

Chapter 10: Extending Struts covers writing plug-ins, custom config objects, and custom request dispatchers
to extend the Struts framework. (More to come.)

Chapter 11: Using Tiles covers using Tiles to create reusable pages and visual components. This chapter covers
building Web applications by assembling reusable tiles. You can use tiles as templates or as visual components.
If you are using Struts but not Tiles, then you are not fully benefiting from Struts and likely repeat yourself
unnecessarily. The Tiles framework makes creating reusable site layouts and visual components feasible. This
chapter covers the following topics: the Tiles framework and architecture, building and using a tile layout as a
site template, using tile definitions using XML config file and/or JSP, moving objects in and out of tile scope,
working with attributes lists, working with nested tiles, building and using tile layouts as small visual components,
extending definitions for maximum JSP reuse, creating a tile controller, and using a tile as an ActionForward.

Chapter 12: Writing Custom Tags covers writing custom tags that work with Struts (more to come).

Chapter 13: Working with Struts I18n support covers I18n (more to come).

Chapter 14: Integrating JSF and Struts covers using StrutsFaces, the Struts JSF support. By using Struts,
Tiles, and JavaServer Faces (JSF) together, developers can ensure a robust, well-presented Web application that
is easy to manage and reuse. The Struts framework is the current de facto web application development framework
for Java. The Tiles framework, which ships as part of Struts, is the de facto document centric, templatingcomponent
framework that ships with Struts. Struts and JSF do overlap. However, Struts provides complementary
features above and beyond the JSF base. Struts works with JSF via its Struts-Faces integration extensions.
Using these extensions allows companies to keep the investment they have in Struts and still migrate to the new
JSF programming model. This chapter covers the following: introduction to JavaServer Faces (JSF) and benefits;
architecture of JSF; combing Struts with JSF; Configurations and Plugins; Architecture of JSF integration; and a
step by step guide to getting all the pieces to work together.

Chapter 15: Integrating Portlets and Struts covers using Struts with Portlets (more to come).

Chapter 16: Using Velocity Struts Tools covers using Velocity for implementing the view (more to come).

Chapter 17: Integrating the Killer open source stack: Spring, Struts and Hibernate covers integrating
Spring, Struts and Hibernate. (more to come).