Acknowledgments | p. ix |
Introduction | p. x |
Introducing the Jakarta Struts Project and Its Supporting Components | p. 1 |
The Jakarta Struts Project | p. 1 |
Understanding the MVC Design Pattern | p. 2 |
The Struts Implementation of the MVC | p. 3 |
Web Applications | p. 5 |
The Directory Structure | p. 6 |
The Web Application Deployment Descriptor | p. 7 |
Packaging a Web Application | p. 8 |
The Tomcat JSP/Servlet Container | p. 8 |
Installing and Configuring Tomcat | p. 8 |
Testing Your Tomcat Installation | p. 9 |
What's Next? | p. 11 |
An Overview of the Java Servlet and JavaServer Pages Architectures | p. 13 |
The Java Servlet Architecture | p. 13 |
The GenericServlet and HttpServlet Classes | p. 15 |
The Lifecycle of a Servlet | p. 15 |
Building a Servlet | p. 16 |
The ServletContext | p. 25 |
Using Servlets to Retrieve HTTP Data | p. 25 |
What Are JavaServer Pages? | p. 30 |
The Components of a JavaServer Page | p. 31 |
What's Next | p. 53 |
Getting Started with Struts | p. 55 |
Obtaining and Installing the Jakarta Struts Archive | p. 55 |
Creating Your First Struts Application | p. 56 |
Creating the Views | p. 57 |
Creating the Controller Components | p. 62 |
Deploying Your Struts Application | p. 66 |
Walking through the ch03app Web Application | p. 68 |
What's Next | p. 71 |
Actions and ActionServlet | p. 73 |
The ActionServlet Class | p. 73 |
Configuring the ActionServlet | p. 75 |
The Action Class | p. 78 |
Extending the Action Class | p. 79 |
Implementing the execute() Method | p. 79 |
Configuring the Action Class | p. 81 |
Struts Plugins | p. 83 |
init() | p. 84 |
destroy() | p. 84 |
Creating a Plugin | p. 84 |
Configuring a Plugin | p. 86 |
The RequestProcessor | p. 87 |
Creating Your Own RequestProcessor | p. 87 |
Configuring an Extended RequestProcessor | p. 89 |
What's Next | p. 90 |
Advanced Action Classes | p. 91 |
ForwardAction and Beyond | p. 91 |
Linking to JSP Directly: More than Just Bad Design | p. 92 |
Linking to Global Forwards Instead of Actions | p. 92 |
Using the forward Attribute vs. ForwardAction | p. 93 |
Don't Bleed Your V into Your C | p. 94 |
Forwards for Legacy Access | p. 94 |
IncludeAction | p. 96 |
DispatchAction | p. 97 |
LookupDispatchAction | p. 100 |
SwitchAction | p. 102 |
What's Next | p. 104 |
Building the Presentation Layer | p. 105 |
Building a Struts View | p. 105 |
JSPs That Gather Data | p. 106 |
ActionForm Beans | p. 109 |
The Steps of a Struts Form Submission | p. 110 |
An Alternative ActionForm:DynaActionForm Bean | p. 111 |
What's Next | p. 116 |
Debugging Struts Applications | p. 117 |
Eclipse | p. 117 |
Installing the Tomcat Plugin | p. 118 |
Debugging Your Struts Application with Eclipse | p. 121 |
IntelliJ | p. 129 |
Configuring Tomcat | p. 129 |
Configuring IntelliJ | p. 130 |
What's Next? | p. 141 |
Working with Custom ActionMappings | p. 143 |
What Is an ActionMapping? | p. 143 |
Creating a Custom ActionMapping | p. 145 |
Creating an ActionMapping Extension for the wroxstruts Application | p. 146 |
Using the ch08.WROXActionMapping Extension in the worxapp Application | p. 147 |
Deploying the ch08.WROXActionMapping Extension | p. 148 |
What's Next | p. 150 |
Internationalizing Your Struts Applications | p. 151 |
i18n Components of a Struts Application | p. 151 |
The Controller | p. 151 |
The View | p. 153 |
Internationalizing the worxapp Application | p. 154 |
What's Next | p. 158 |
Managing Errors | p. 159 |
Struts Error Management | p. 159 |
ActionError | p. 159 |
ActionErrors | p. 161 |
Adding Error Handling to the wroxapp Application | p. 162 |
The ActionForm.validate() Method | p. 163 |
[left angle bracket]html:errors/[right angle bracket] | p. 165 |
Error Management in the Action.execute() Method | p. 167 |
What's Next? | p. 170 |
Integrating the Jakarta Commons Database Connection Pool (DBCP) | p. 171 |
What Is the Commons DBCP? | p. 171 |
Integrating the DBCP into Your Struts Application | p. 171 |
Creating a Sample Database | p. 172 |
Using the DBCP in Your Struts Application | p. 173 |
What's Next | p. 179 |
Working with the Validator | p. 181 |
Getting Started with the Validator Framework | p. 182 |
Understanding the Standard Steps | p. 183 |
Understanding the Validator Framework | p. 186 |
An Overview of the Standard Rules | p. 190 |
Using Two Rules on the Same Field (the maxfield Rule) | p. 190 |
Using the Mask Rule | p. 192 |
Constants | p. 195 |
Working with Dates | p. 196 |
Making Fields Required | p. 197 |
Working with E-Mail and Credit Cards | p. 197 |
Extending Validate and Custom Validation in the Validate Method of an Action | p. 198 |
Writing Your Own Rules | p. 199 |
Working with DynaActionForms | p. 203 |
Working with Client-Side JavaScript | p. 204 |
Canceling JavaScript validate | p. 205 |
Using a Workflow Form | p. 205 |
i18n for Validation | p. 213 |
Summary | p. 213 |
Using Tiles | p. 215 |
The Tiles Framework | p. 216 |
Clarification of Terms | p. 216 |
Creating a Tile Layout | p. 219 |
Using a Tile Layout | p. 222 |
Creating a Definition | p. 224 |
Creating and Using a JSP Definition | p. 224 |
Creating and Using an XML Definition | p. 227 |
Understanding Tile Scope | p. 228 |
Understanding Lists | p. 232 |
Using putList in XML | p. 232 |
Using the List in the Tile Layout | p. 233 |
Using putList in JSP | p. 235 |
Extending Definitions | p. 236 |
Nesting Tiles | p. 237 |
Creating a Visual Component | p. 238 |
Using the Visual Component | p. 239 |
Using a Tile as a Parameter to Another Tile | p. 239 |
Tile Controllers | p. 240 |
Using a Tile as an ActionForward | p. 242 |
What's Next | p. 243 |
Developing a Complete Struts Application | p. 245 |
The Employees Application Definition | p. 245 |
Preparing the employees Application | p. 245 |
Creating the employees Model | p. 250 |
Building the Employees Application | p. 261 |
Walkthrough | p. 287 |
What's Next? | p. 289 |
The struts-config.xml File | p. 291 |
The Struts Sub-Elements | p. 292 |
The [left angle bracket]icon/[right angle bracket] Sub-Element | p. 293 |
The [left angle bracket]display-name/[right angle bracket] Sub-Element | p. 294 |
The [left angle bracket]description/[right angle bracket] Sub-Element | p. 294 |
The [left angle bracket]set-property/[right angle bracket] Sub-Element | p. 294 |
Adding a DataSource | p. 295 |
Adding FormBean Definitions | p. 296 |
Adding Global Exceptions | p. 297 |
Adding Global Forwards | p. 298 |
Adding Actions | p. 299 |
Adding Controller Elements | p. 301 |
Adding Message Resources | p. 302 |
Adding Plugins | p. 303 |
What's Next | p. 303 |
The HTML Tag Library | p. 305 |
Installing the HTML Tags | p. 305 |
[left angle bracket]html:base/[right angle bracket] | p. 306 |
[left angle bracket]html:button/[right angle bracket] | p. 306 |
[left angle bracket]html:cancel/[right angle bracket] | p. 308 |
[left angle bracket]html:checkbox/[right angle bracket] | p. 309 |
[left angle bracket]html:errors/[right angle bracket] | p. 311 |
[left angle bracket]html:file/[right angle bracket] | p. 312 |
[left angle bracket]html:form/[right angle bracket] | p. 314 |
[left angle bracket]html:hidden/[right angle bracket] | p. 315 |
[left angle bracket]html:html/[right angle bracket] | p. 316 |
[left angle bracket]html:image/[right angle bracket] | p. 317 |
[left angle bracket]html:img/[right angle bracket] | p. 319 |
[left angle bracket]html:javascript/[right angle bracket] | p. 321 |
[left angle bracket]html:link/[right angle bracket] | p. 322 |
[left angle bracket]html:messages/[right angle bracket] | p. 325 |
[left angle bracket]html:multibox/[right angle bracket] | p. 325 |
[left angle bracket]html:option/[right angle bracket] | p. 327 |
[left angle bracket]html:options/[right angle bracket] | p. 328 |
[left angle bracket]html:optionsCollection/[right angle bracket] | p. 329 |
[left angle bracket]html:password/[right angle bracket] | p. 329 |
[left angle bracket]html:radio/[right angle bracket] | p. 331 |
[left angle bracket]html:reset/[right angle bracket] | p. 333 |
[left angle bracket]html:rewrite/[right angle bracket] | p. 335 |
[left angle bracket]html:select/[right angle bracket] | p. 336 |
[left angle bracket]html:submit/[right angle bracket] | p. 338 |
[left angle bracket]html:text/[right angle bracket] | p. 339 |
[left angle bracket]html:textarea/[right angle bracket] | p. 341 |
[left angle bracket]html:xhtml/[right angle bracket] | p. 343 |
The Tiles Tag Library | p. 345 |
Installing the Tiles Tags | p. 345 |
[left angle bracket]tiles:insert/[right angle bracket] | p. 346 |
[left angle bracket]tiles:definition/[right angle bracket] | p. 347 |
[left angle bracket]tiles:put/[right angle bracket] | p. 347 |
[left angle bracket]tiles:putList/[right angle bracket] | p. 348 |
[left angle bracket]tiles:add/[right angle bracket] | p. 349 |
[left angle bracket]tiles:get/[right angle bracket] | p. 349 |
[left angle bracket]tiles:getAsString/[right angle bracket] | p. 350 |
[left angle bracket]tiles:useAttribute/[right angle bracket] | p. 350 |
[left angle bracket]tiles:importAttribute/[right angle bracket] | p. 350 |
[left angle bracket]tiles:initComponentDefinitions/[right angle bracket] | p. 351 |
The Logic Tag Library | p. 353 |
Installing the Logic Tags | p. 353 |
[left angle bracket]logic:empty/[right angle bracket] | p. 354 |
[left angle bracket]logic:notEmpty/[right angle bracket] | p. 354 |
[left angle bracket]logic:equal/[right angle bracket] | p. 355 |
[left angle bracket]logic:notEqual/[right angle bracket] | p. 356 |
[left angle bracket]logic:forward/[right angle bracket] | p. 356 |
[left angle bracket]logic:redirect/[right angle bracket] | p. 357 |
[left angle bracket]logic:greaterEqual/[right angle bracket] | p. 358 |
[left angle bracket]logic:greaterThan/[right angle bracket] | p. 359 |
[left angle bracket]logic:iterate/[right angle bracket] | p. 359 |
[left angle bracket]logic:lessEqual/[right angle bracket] | p. 361 |
[left angle bracket]logic:lessThan/[right angle bracket] | p. 361 |
[left angle bracket]logic:match/[right angle bracket] | p. 362 |
[left angle bracket]logic:notMatch/[right angle bracket] | p. 363 |
[left angle bracket]logic:present/[right angle bracket] | p. 364 |
[left angle bracket]logic:notPresent/[right angle bracket] | p. 365 |
The Template Tag Library | p. 367 |
Installing the Template Tags | p. 367 |
[left angle bracket]template:get/[right angle bracket] | p. 368 |
[left angle bracket]template:insert/[right angle bracket] | p. 369 |
[left angle bracket]template:put/[right angle bracket] | p. 369 |
The Bean Tag Library | p. 371 |
Installing the Bean Tags | p. 371 |
[left angle bracket]bean:cookie/[right angle bracket] | p. 372 |
[left angle bracket]bean:define/[right angle bracket] | p. 372 |
[left angle bracket]bean:header/[right angle bracket] | p. 374 |
[left angle bracket]bean:include/[right angle bracket] | p. 374 |
[left angle bracket]bean:message/[right angle bracket] | p. 375 |
[left angle bracket]bean:page/[right angle bracket] | p. 376 |
[left angle bracket]bean:parameter/[right angle bracket] | p. 377 |
[left angle bracket]bean:resource/[right angle bracket] | p. 378 |
[left angle bracket]bean:size/[right angle bracket] | p. 378 |
[left angle bracket]bean:struts/[right angle bracket] | p. 379 |
[left angle bracket]bean:write/[right angle bracket] | p. 380 |
Struts Cookbook | p. 381 |
Action Helper Methods | p. 381 |
Action saveToken and isTokenValid | p. 381 |
Action isCancelled | p. 385 |
Action getLocale and setLocale | p. 386 |
Action saveMessages and getResources | p. 387 |
Populating ActionForms with Domain Objects | p. 390 |
Uploading Files | p. 391 |
Context-Sensitive Error Messages | p. 392 |
Best Practices | p. 397 |
i18n Best Practices | p. 397 |
Read the DTDs | p. 397 |
Read the Source | p. 398 |
Understand MVC, Model 2, Sun's Blueprints for J2EE, and J2EE design patterns | p. 398 |
Don't Use Java Scriptlets in JSP ([left angle bracket]% %[right angle bracket]) | p. 398 |
Limit the Logic in Your JSPs | p. 398 |
Create Multiple Resource Bundles per Module | p. 399 |
Break Up Your struts-config.xml File | p. 399 |
Break Your Application Up into Modules | p. 399 |
Use html:messages instead of html:errors | p. 400 |
Develop Your Own Custom Tags | p. 400 |
Declaratively Handle Exceptions | p. 400 |
For Visual Components, Use Tile Layouts | p. 402 |
Start Using Tiles | p. 402 |
Start Using the Validator Framework | p. 402 |
Group Related Actions | p. 402 |
Never Link to a JSP | p. 404 |
Extend Actions with Action Chaining | p. 404 |
Don't Use DynaActionForms without the Validator Framework | p. 404 |
Use JSTL instead of Struts-Equivalent Tags | p. 405 |
Use JSTL EL in Your Custom Tags | p. 407 |
Useful Related Utilities | p. 409 |
Cactus | p. 409 |
StrutsTestCase | p. 413 |
XDoclet | p. 413 |
Index | p. 419 |
Table of Contents provided by Ingram. All Rights Reserved. |
The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.