Acknowledgments |
|
xxi | |
|
Part I The Struts Framework |
|
|
|
An Introduction to Struts |
|
|
3 | (8) |
|
A Brief History of Web Application Development |
|
|
3 | (2) |
|
|
5 | (1) |
|
Model 1 Architecture Overview |
|
|
5 | (1) |
|
Model 2 Architecture Overview |
|
|
5 | (1) |
|
A Closer Look at the Model-View-Controller Architecture |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
Basic Components of Struts |
|
|
8 | (2) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
Getting Started with Struts |
|
|
10 | (1) |
|
Building a Simple Struts Application |
|
|
11 | (30) |
|
|
11 | (21) |
|
The Mini HR Application Files |
|
|
11 | (2) |
|
|
13 | (2) |
|
|
15 | (6) |
|
|
21 | (2) |
|
|
23 | (2) |
|
EmployeeSearchService.java |
|
|
25 | (2) |
|
|
27 | (1) |
|
|
28 | (1) |
|
|
29 | (3) |
|
MessageResources.properties |
|
|
32 | (1) |
|
Compiling, Packaging, and Running the Application |
|
|
32 | (6) |
|
Downloading and Installing Struts and Tomcat |
|
|
33 | (1) |
|
Compiling the Application |
|
|
33 | (2) |
|
Packaging the Application |
|
|
35 | (1) |
|
|
35 | (3) |
|
Understanding the Flow of Execution |
|
|
38 | (3) |
|
|
41 | (6) |
|
|
41 | (1) |
|
|
41 | (1) |
|
|
42 | (2) |
|
Using BeanUtils to Transfer Data to Model Classes |
|
|
42 | (2) |
|
Reviewing the Model Layer of the Mini HR Application |
|
|
44 | (3) |
|
|
47 | (18) |
|
Struts and the View Layer |
|
|
47 | (13) |
|
|
48 | (1) |
|
|
48 | (9) |
|
|
57 | (1) |
|
|
58 | (2) |
|
Reviewing the View Layer of the Mini HR Application |
|
|
60 | (4) |
|
Alternative View Technologies |
|
|
64 | (1) |
|
|
65 | (24) |
|
Struts and the Controller Layer |
|
|
65 | (1) |
|
|
66 | (1) |
|
The Request Processing Engine |
|
|
67 | (4) |
|
Jakarta Commons Chain-Based Request Processing |
|
|
68 | (1) |
|
RequestProcessor Class-Based Processing |
|
|
69 | (2) |
|
|
71 | (14) |
|
Retrieving Values from Form Beans |
|
|
71 | (2) |
|
Customizing the Response from an Action |
|
|
73 | (1) |
|
|
73 | (12) |
|
|
85 | (1) |
|
Reviewing the Controller Layer of the Mini HR Application |
|
|
86 | (3) |
|
|
89 | (42) |
|
|
89 | (1) |
|
|
90 | (29) |
|
Enabling the Validator Plugin |
|
|
90 | (1) |
|
|
91 | (3) |
|
Configuring validator-rules.xml |
|
|
94 | (1) |
|
Configuring the Application Resource Bundle File |
|
|
95 | (2) |
|
Configuring validation.xml |
|
|
97 | (5) |
|
Using Validator's Included Validations |
|
|
102 | (14) |
|
Enabling Client-Side Validations |
|
|
116 | (3) |
|
Creating Custom Validations |
|
|
119 | (5) |
|
Creating a Validation Method |
|
|
119 | (2) |
|
Adding a New Validation Rule |
|
|
121 | (2) |
|
Adding New Validation Definitions |
|
|
123 | (1) |
|
Adding Messages to the MessageResources.properties File |
|
|
124 | (1) |
|
Internationalizing Validations |
|
|
124 | (2) |
|
Adding Validator to the Mini HR Application |
|
|
126 | (5) |
|
Change SearchForm to Extend ValidatorForm |
|
|
126 | (1) |
|
Create a validation.xml File |
|
|
127 | (1) |
|
Add the Validator Plugin to the struts-config.xml File |
|
|
128 | (1) |
|
Add Validation Error Messages to the MessageResources.properties File |
|
|
129 | (1) |
|
Compile, Package, and Run the Updated Application |
|
|
129 | (2) |
|
|
131 | (30) |
|
|
133 | (1) |
|
|
133 | (7) |
|
Enabling the Tiles Plugin |
|
|
133 | (1) |
|
Creating Tiles Definitions |
|
|
134 | (4) |
|
Creating Layout JSPs and Using the Tiles Tag Library |
|
|
138 | (1) |
|
|
138 | (1) |
|
Using the Tiles Definitions |
|
|
139 | (1) |
|
Handling Relative URLS with Tiles |
|
|
140 | (1) |
|
|
140 | (3) |
|
Using the Tiles Tag Library |
|
|
143 | (1) |
|
The Tiles Tag Library Tags |
|
|
143 | (10) |
|
|
145 | (1) |
|
|
146 | (1) |
|
|
147 | (1) |
|
|
147 | (1) |
|
The initComponentDefinitions Tag |
|
|
148 | (1) |
|
|
148 | (2) |
|
|
150 | (1) |
|
|
151 | (1) |
|
|
152 | (1) |
|
Adding Tiles to the Mini HR Application |
|
|
153 | (8) |
|
|
153 | (2) |
|
Update Existing JSPs to Work with Layouts |
|
|
155 | (2) |
|
Create a tiles-defs.xml Tiles Configuration File |
|
|
157 | (1) |
|
Update the struts-config.xml Struts Configuration File |
|
|
158 | (2) |
|
Repackage and Run the Updated Application |
|
|
160 | (1) |
|
Declarative Exception Handling |
|
|
161 | (12) |
|
Configuring Struts' Exception Handler |
|
|
161 | (2) |
|
Exception Handling for Committed Responses |
|
|
162 | (1) |
|
Creating a Custom Exception Handler |
|
|
163 | (3) |
|
Create a New Exception Handler Class |
|
|
164 | (2) |
|
Add New Exception Handler Definitions to the Application's Struts Configuration File |
|
|
166 | (1) |
|
Adding Declarative Exception Handling to the Mini HR Application |
|
|
166 | (7) |
|
Create an Application Exception Class |
|
|
167 | (1) |
|
Update SearchAction to Throw an Application Exception |
|
|
167 | (1) |
|
Set Up an Exception Handler in the struts-config.xml Configuration File |
|
|
168 | (2) |
|
Create an Exception Handler JSP |
|
|
170 | (1) |
|
Add an Exception Error Message to the MessageResources.properties File |
|
|
170 | (1) |
|
Recompile, Repackage, and Run the Updated Application |
|
|
171 | (2) |
|
|
173 | (14) |
|
|
174 | (3) |
|
Creating a Struts Configuration File for Each Module |
|
|
174 | (1) |
|
Configuring the web.xml Deployment Descriptor for Modules |
|
|
175 | (1) |
|
Configuring Links to Access Module-Specific JSPs |
|
|
176 | (1) |
|
Using Validator with Modules |
|
|
177 | (1) |
|
|
177 | (1) |
|
Converting the Mini HR Application to Use Modules |
|
|
178 | (9) |
|
Set Up Module Directories and Files |
|
|
179 | (1) |
|
Create a Struts Configuration File for Each Module |
|
|
180 | (1) |
|
Update the Application's web.xml Deployment Descriptor File |
|
|
181 | (2) |
|
Update the index.jsp File to Link to Each of the Modules |
|
|
183 | (1) |
|
Repackage and Run the Updated Application |
|
|
183 | (4) |
|
|
|
Internationalizing Struts Applications |
|
|
187 | (14) |
|
Understanding Java's Internationalization Support |
|
|
187 | (3) |
|
The java.util.Locale Class |
|
|
188 | (1) |
|
The java.util.ResourceBundle Class |
|
|
189 | (1) |
|
The java.text.MessageFormat Class |
|
|
190 | (1) |
|
Understanding Struts' Internationalization Support |
|
|
190 | (4) |
|
|
191 | (1) |
|
|
191 | (2) |
|
Struts' Tag Library Support for Internationalization |
|
|
193 | (1) |
|
Internationalizing the Mini HR Application |
|
|
194 | (1) |
|
Add Entries for All Application Text to the MessageResources.properties Resource Bundle File |
|
|
195 | (1) |
|
Create a Spanish Version of the MessageResources.properties File |
|
|
195 | (1) |
|
Update JSPs to Retrieve All Application Text from the MessageResources.properties File |
|
|
196 | (2) |
|
Repackage and Run the Updated Application |
|
|
198 | (3) |
|
Securing Struts Applications |
|
|
201 | (24) |
|
|
201 | (3) |
|
Providing Secure Communications |
|
|
201 | (1) |
|
Authentication and Authorization |
|
|
202 | (1) |
|
Role-Based Access Control |
|
|
202 | (1) |
|
Container- vs. Application-Managed Security |
|
|
202 | (2) |
|
Using Container-Managed Security |
|
|
204 | (7) |
|
|
205 | (5) |
|
Container-Managed Secure Transport |
|
|
210 | (1) |
|
Application-Managed Security |
|
|
211 | (14) |
|
Creating a Security Service |
|
|
211 | (10) |
|
Integrating Struts with SSL |
|
|
221 | (4) |
|
Testing Struts Applications |
|
|
225 | (26) |
|
|
225 | (1) |
|
|
225 | (1) |
|
|
226 | (1) |
|
|
226 | (1) |
|
Unit Testing Struts Applications |
|
|
226 | (14) |
|
|
227 | (3) |
|
Testing Controller Behavior |
|
|
230 | (8) |
|
|
238 | (2) |
|
|
240 | (5) |
|
|
241 | (1) |
|
|
242 | (3) |
|
Testing Application Performance |
|
|
245 | (6) |
|
Part III The Struts Tag Libraries |
|
|
|
|
251 | (60) |
|
Understanding Variables and Scope in JSP Pages |
|
|
251 | (1) |
|
Using the HTML Tag Library |
|
|
252 | (1) |
|
The HTML Tag Library Tags |
|
|
253 | (54) |
|
|
255 | (1) |
|
|
256 | (1) |
|
|
257 | (2) |
|
|
259 | (1) |
|
|
260 | (2) |
|
|
262 | (2) |
|
|
264 | (2) |
|
|
266 | (4) |
|
|
270 | (1) |
|
|
271 | (1) |
|
|
272 | (2) |
|
|
274 | (4) |
|
|
278 | (2) |
|
|
280 | (3) |
|
|
283 | (2) |
|
|
285 | (2) |
|
|
287 | (1) |
|
|
287 | (2) |
|
The optionsCollection Tag |
|
|
289 | (1) |
|
|
290 | (2) |
|
|
292 | (2) |
|
|
294 | (2) |
|
|
296 | (3) |
|
|
299 | (2) |
|
|
301 | (1) |
|
|
302 | (2) |
|
|
304 | (3) |
|
|
307 | (1) |
|
|
307 | (4) |
|
|
311 | (22) |
|
Understanding Variables and Scope in JSPs |
|
|
311 | (1) |
|
Using the Bean Tag Library |
|
|
312 | (1) |
|
The Bean Tag Library Tags |
|
|
313 | (20) |
|
|
314 | (2) |
|
|
316 | (2) |
|
|
318 | (2) |
|
|
320 | (1) |
|
|
321 | (2) |
|
|
323 | (1) |
|
|
324 | (2) |
|
|
326 | (1) |
|
|
327 | (2) |
|
|
329 | (2) |
|
|
331 | (2) |
|
|
333 | (40) |
|
Understanding Variables and Scope in JSPs |
|
|
333 | (1) |
|
Using the Logic Tag Library |
|
|
334 | (1) |
|
The Logic Tag Library Tags |
|
|
335 | (38) |
|
|
337 | (1) |
|
|
338 | (2) |
|
|
340 | (1) |
|
|
341 | (2) |
|
|
343 | (2) |
|
|
345 | (3) |
|
|
348 | (2) |
|
|
350 | (2) |
|
|
352 | (3) |
|
The messagesNotPresent Tag |
|
|
355 | (1) |
|
|
356 | (1) |
|
|
356 | (1) |
|
|
357 | (3) |
|
|
360 | (2) |
|
|
362 | (3) |
|
|
365 | (2) |
|
|
367 | (6) |
|
|
373 | (8) |
|
Understanding Object Nesting in Struts |
|
|
373 | (1) |
|
Using the Nested Tag Library |
|
|
374 | (1) |
|
The Nested Tag Library Tags |
|
|
375 | (6) |
|
|
377 | (1) |
|
|
378 | (1) |
|
|
379 | (2) |
|
|
381 | (18) |
|
|
381 | (6) |
|
The JSTL Expression Language |
|
|
382 | (3) |
|
|
385 | (2) |
|
|
387 | (12) |
|
JSTL Replacement Examples |
|
|
389 | (3) |
|
Using the Struts EL Tag Libraries |
|
|
392 | (1) |
|
The Struts EL Tag Library Tags |
|
|
393 | (6) |
|
Part IV Struts Configuration Files |
|
|
|
The Struts Configuration File |
|
|
399 | (20) |
|
|
399 | (1) |
|
Configuring the web.xml Deployment Descriptor |
|
|
400 | (1) |
|
The Struts Configuration File Tags |
|
|
401 | (16) |
|
|
402 | (3) |
|
|
405 | (1) |
|
|
405 | (3) |
|
|
408 | (1) |
|
|
409 | (1) |
|
|
410 | (1) |
|
|
411 | (1) |
|
|
412 | (1) |
|
The global-exceptions Tag |
|
|
413 | (1) |
|
|
413 | (1) |
|
The message-resources Tag |
|
|
414 | (1) |
|
|
415 | (1) |
|
|
416 | (1) |
|
|
416 | (1) |
|
|
417 | (1) |
|
Editing Struts Configuration Files with Struts Console |
|
|
417 | (2) |
|
The Tiles Configuration File |
|
|
419 | (10) |
|
|
419 | (1) |
|
Enabling the Tiles Plugin |
|
|
420 | (1) |
|
The Tiles Configuration File Tags |
|
|
421 | (6) |
|
|
422 | (1) |
|
|
422 | (1) |
|
|
423 | (1) |
|
|
424 | (1) |
|
|
425 | (1) |
|
|
425 | (1) |
|
|
426 | (1) |
|
The tiles-definitions Tag |
|
|
427 | (1) |
|
|
427 | (1) |
|
Editing Tiles Configuration Files with Struts Console |
|
|
428 | (1) |
|
The Validator Configuration Files |
|
|
429 | (18) |
|
|
429 | (1) |
|
|
430 | (1) |
|
Enabling the Validator Plugin |
|
|
430 | (1) |
|
The Validator Configuration File Tags |
|
|
431 | (12) |
|
|
432 | (1) |
|
|
433 | (1) |
|
|
434 | (1) |
|
|
434 | (1) |
|
|
434 | (1) |
|
|
435 | (1) |
|
|
436 | (1) |
|
|
436 | (2) |
|
|
438 | (1) |
|
|
438 | (1) |
|
|
439 | (1) |
|
|
440 | (1) |
|
|
441 | (1) |
|
|
442 | (1) |
|
|
442 | (1) |
|
|
443 | (1) |
|
Editing Validator Configuration Files with Struts Console |
|
|
443 | (4) |
|
|
|
|
447 | (10) |
|
Bean Scripting Framework Overview |
|
|
447 | (1) |
|
Struts Scripting Overview |
|
|
448 | (1) |
|
|
448 | (5) |
|
Adding the Struts Scripting .jar Files and Properties File to the Application |
|
|
449 | (1) |
|
Creating Script-Based Actions |
|
|
450 | (1) |
|
Configuring Script-Based Actions in the Application's Struts Configuration File |
|
|
450 | (1) |
|
Predefined Scripting Variables |
|
|
451 | (2) |
|
Using Struts Scripting with the Mini HR Application |
|
|
453 | (4) |
|
Add the Struts Scripting .jar Files and Properties File to the Application |
|
|
454 | (1) |
|
Convert SearchAction to a Groovy Script |
|
|
454 | (1) |
|
Configure the struts-config.xml File |
|
|
455 | (1) |
|
Repackage and Run the Updated Application |
|
|
456 | (1) |
|
The Struts-Faces Integration Library |
|
|
457 | (28) |
|
|
457 | (1) |
|
Struts-Faces Library Overview |
|
|
457 | (1) |
|
Supported Versions of Struts |
|
|
458 | (1) |
|
Supported Versions of JSF |
|
|
458 | (1) |
|
Using the Struts-Faces Library |
|
|
458 | (4) |
|
Adding the Required .jar Files to the Application |
|
|
459 | (1) |
|
Adding a Servlet Definition for the JSF Controller Servlet to the web.xml File |
|
|
459 | (1) |
|
Configuring Struts to Use a Custom Struts-Faces Request Processor |
|
|
460 | (1) |
|
Using the Struts-Faces and JSF Tag Library Tags to Create JSF-Based User Interfaces |
|
|
460 | (1) |
|
Configuring Forward and Action Definitions in the Application's Struts Configuration File |
|
|
461 | (1) |
|
|
461 | (1) |
|
The Struts-Faces Tag Library Tags |
|
|
462 | (15) |
|
|
463 | (1) |
|
|
464 | (3) |
|
|
467 | (2) |
|
|
469 | (1) |
|
|
470 | (1) |
|
|
471 | (2) |
|
|
473 | (1) |
|
|
474 | (2) |
|
|
476 | (1) |
|
|
476 | (1) |
|
Using the Struts-Faces Library with the Mini HR Application |
|
|
477 | (8) |
|
Add a JSF Implementation's and JSTL .jar Files to the Application |
|
|
478 | (1) |
|
Add a Servlet Definition for the JSF Controller Servlet to the web.xml File |
|
|
478 | (2) |
|
Configure the struts-config.xml File |
|
|
480 | (1) |
|
Update Existing JSPs to Use the Struts-Faces and JSF Tag Library Tags |
|
|
481 | (2) |
|
Repackage and Run the Updated Application |
|
|
483 | (2) |
|
|
485 | (12) |
|
|
485 | (1) |
|
Integrating AJAX with the Mini HR Application |
|
|
486 | (11) |
|
Add getEmployeeCount() to EmployeeSearchService |
|
|
486 | (1) |
|
Create a CountAction Class |
|
|
487 | (1) |
|
Configure the CountAction Class in the struts-config.xml File |
|
|
488 | (1) |
|
Update search.jsp to Use AJAX |
|
|
489 | (3) |
|
Recompile, Repackage, and Run the Updated Application |
|
|
492 | (5) |
|
|
|
Struts Console Quick Reference |
|
|
497 | (18) |
|
Supported Configuration Files |
|
|
498 | (2) |
|
Acquiring and Installing Struts Console |
|
|
500 | (1) |
|
Using Struts Console as a Stand-Alone Application |
|
|
500 | (1) |
|
Using Struts Console Inside Borland JBuilder |
|
|
501 | (2) |
|
Using Struts Console Inside Eclipse |
|
|
503 | (2) |
|
Using Struts Console Inside IBM Rational Application Developer for WebSphere |
|
|
505 | (2) |
|
Using Struts Console Inside IntelliJ IDEA |
|
|
507 | (2) |
|
Using Struts Console Inside NetBeans and Sun Java Studio |
|
|
509 | (2) |
|
Using Struts Console Inside Oracle JDeveloper |
|
|
511 | (2) |
|
Configuring the Struts Console Output Options |
|
|
513 | (2) |
|
Third-Party Struts Extensions |
|
|
515 | (2) |
|
|
515 | (1) |
|
|
515 | (1) |
|
|
516 | (1) |
|
|
516 | (1) |
|
|
516 | (1) |
|
|
516 | (1) |
|
|
516 | (1) |
|
|
516 | (1) |
Index |
|
517 | |