
Pro Apache Struts with Ajax
By: John Carnell, Kunal Mittal (Editor), Rob Harrop (As told to)
Paperback | 28 June 2010
At a Glance
530 Pages
22.86 x 17.78 x 3.18
Paperback
$64.99
or 4 interest-free payments of $16.25 with
 orÂShips in 5 to 7 business days
This book maps out how to employ the most widely used Apache Struts MVC Web framework. The authors take an application-centric approach: the development of an application drives the Struts along with Ajax coverage, rather than the other way around. Improper design can lead to long term dependencies on the Struts framework, which makes code re-use difficult. Here the authors helpfully discuss Struts from an anti-pattern perspective, in a chapter entitled What We Do Wrong: Web Antipatterns Explained. Other chapter titles include: Managing Business Logic with Struts; Architecting the Data Access Tier with ObjectRelationalBridge; Building Flexible Front-Ends with the Tiles Framework; Dynamic Forms using Ajax and the Struts Validator Framework; Speeding Struts Development with XDoclet, and Logging and Debugging. Appendices discuss JavaEdge setup, Struts development tools, and Apache Struts Ti/WebWork. The end result: you will learn to use Struts very effectively
| About the Authors | p. xv |
| About the Editor | p. xvi |
| About the Technical Reviewers | p. xvii |
| Acknowledgments | p. xviii |
| Preface for This Edition | p. xix |
| Preface from Previous Edition | p. xx |
| What We Do Wrong: Web Antipatterns Explained | p. 1 |
| What This Book Is About | p. 3 |
| What This Chapter Is About | p. 4 |
| Challenges of Web Application Development | p. 4 |
| Enterprise Services | p. 6 |
| Application Services | p. 7 |
| An Introduction to Patterns and Antipatterns | p. 8 |
| Web Application Antipatterns | p. 9 |
| Concern Slush | p. 10 |
| Tier Leakage | p. 13 |
| Hardwired | p. 16 |
| Validation Confusion | p. 18 |
| Tight-Skins | p. 20 |
| Data Madness | p. 22 |
| Antipatterns, JOS Frameworks, and Economics | p. 24 |
| The JavaEdge Application | p. 27 |
| Summary | p. 28 |
| Struts Fundamentals | p. 31 |
| The JavaEdge Application Architecture | p. 32 |
| The Design | p. 33 |
| Using Struts to Implement the MVC Pattern | p. 34 |
| Getting Started: The JavaEdge Source Tree | p. 37 |
| The Power of the Command Pattern | p. 48 |
| Constructing the Presentation Tier | p. 52 |
| The JavaEdge Home Page | p. 53 |
| Bean Tags | p. 57 |
| Logic Tags | p. 67 |
| Iteration Tags | p. 68 |
| Conditional Tags | p. 69 |
| Movement Tags | p. 71 |
| Summary | p. 73 |
| Form Presentation and Validation with Struts | p. 75 |
| Problems with Form Validation | p. 75 |
| Using Struts for Form Validation | p. 77 |
| Implementing Form Validation with Struts | p. 79 |
| The struts-config.xml File | p. 80 |
| Struts ActionForm Class | p. 81 |
| Prepopulating an ActionForm with Data | p. 87 |
| Another Technique for Prepopulation | p. 91 |
| Prepopulating a Form the Correct Way | p. 92 |
| Validating the Form Data | p. 93 |
| The Struts HTML Tag Library | p. 103 |
| Setting Up a Struts HTML Form | p. 104 |
| Using Text and TextArea Input Fields | p. 107 |
| Drop-Down Lists, Checkboxes, and Radio Buttons | p. 108 |
| Building More Dynamic ActionForms | p. 111 |
| ActionForms and Business Logic | p. 118 |
| Summary | p. 122 |
| Managing Business Logic with Struts | p. 123 |
| Business Logic Antipatterns and Struts | p. 124 |
| Concern Slush and Struts | p. 125 |
| Tier Leakage and Struts | p. 130 |
| Separating Business Logic from Struts | p. 132 |
| Implementing the Design Patterns | p. 134 |
| Implementing the Business Delegate Pattern | p. 135 |
| Implementing the Service Locator Pattern | p. 141 |
| The Service Locator Revisited | p. 149 |
| EJBs and Struts | p. 154 |
| Handling Exceptions in the Action Class | p. 160 |
| Exception Handling in Struts 1.0.x | p. 161 |
| Exception Handling in Struts 1.1 and Later | p. 163 |
| Rewriting the ApplicationException Class | p. 164 |
| Setting Up the struts-config.xml File | p. 164 |
| Writing a Custom ExceptionHandler | p. 167 |
| Summary | p. 171 |
| Architecting the Data Access Tier with | |
| ObjectRelationalBridge | p. 173 |
| Developing a Data Access Strategy | p. 174 |
| The JavaEdge Data Access Model | p. 176 |
| Value Objects | p. 182 |
| The JavaEdge Value Objects | p. 184 |
| Using an O/R Mapping Tool | p. 187 |
| Setting Up the Object/Relational Mappings | p. 190 |
| Which Sequence Manager to Use? | p. 201 |
| OJB in Action | p. 208 |
| Retrieving Data: A Simple Example | p. 212 |
| Retrieving Data: A More Complicated Example | p. 215 |
| Storing Data Using OJB | p. 217 |
| Deleting Data with OJB | p. 219 |
| Bringing It All Together | p. 219 |
| Summary | p. 223 |
| Building Flexible Front-Ends with the Tiles Framework | p. 225 |
| What Is the Tiles Framework? | p. 227 |
| Enabling Struts Version 1.1 to Use Tiles | p. 228 |
| Configuring the Tiles Plug-In | p. 229 |
| The tiles-defs.xml File | p. 231 |
| Adding the Tiles TLDs | p. 231 |
| Your First Tiles Template | p. 232 |
| What Are Tiles Definitions? | p. 235 |
| Tiles Definitions: A JSP-Based Approach | p. 236 |
| Overriding the Attribute Values in a Tiles Definition | p. 238 |
| Using Dummy Values in Your Tiles Definition | p. 239 |
| Disadvantages of JSP Tiles Definitions | p. 239 |
| Anatomy of the tiles-defs.xml File | p. 240 |
| Inheritance Using Tiles Definitions | p. 241 |
| Extending a Tiles Definition | p. 244 |
| Modifying the template.jsp File | p. 245 |
| Adding the New Definition to tiles-defs.xml | p. 246 |
| Modifying the .homePage Definition | p. 247 |
| Mapping Tiles Definitions to Action Forwards | p. 248 |
| Summary | p. 252 |
| Dynamic Forms and the Struts Validator Framework | p. 255 |
| Introducing Dynamic Forms | p. 256 |
| Defining the postStoryForm Struts Form Bean | p. 256 |
| Writing the PostStoryDynaForm.java Implementation | p. 258 |
| Some Thoughts About BeanUtils and the Preceding Code | p. 263 |
| The Jakarta Commons Validator Framework | p. 266 |
| Validator Framework Setup | p. 266 |
| Implementing the Required Fields Validation | p. 268 |
| The maxlength Validation Rule | p. 270 |
| Use the Validator Framework Within an ActionForm Class | p. 273 |
| Writing Your Own Validation Rules | p. 275 |
| Implementing the Vulgarity Rule | p. 275 |
| Adding the Vulgarity Rule to the validator-rules.xml File | p. 279 |
| Struts Validation and Potential Long-Term Consequences | p. 281 |
| Implementing the Vulgarity Rule in a Form | p. 282 |
| An ActionForm Without Java | p. 283 |
| When to Use the Validator Framework | p. 284 |
| Summary | p. 285 |
| Speeding Struts Development with XDoclet | p. 289 |
| Installing XDoclet | p. 291 |
| What Exactly Is XDoclet? | p. 292 |
| From XDoclet to Source, and All the Steps in Between | p. 295 |
| The Available XDoclet Tags | p. 297 |
| Anatomy of an XDoclet Tag | p. 298 |
| Integrating Ant and XDoclet | p. 299 |
| Using Merge Points | p. 302 |
| XDoclet and Struts | p. 303 |
| Declaring Struts Form Beans | p. 304 |
| Declaring Struts Actions | p. 304 |
| XDoclet and Java Inheritance | p. 306 |
| Declaring Application Exceptions | p. 306 |
| Building struts-config.xml Using | p. 308 |
| XDoclets and the Validator Framework | p. 309 |
| Generating the Validator Tags from Ant | p. 313 |
| Summary | p. 315 |
| Logging and Debugging | p. 317 |
| Why Use Logging? | p. 318 |
| Log Message Levels | p. 319 |
| Simple Web Application Logging | p. 319 |
| Logging with ServletContext | p. 319 |
| Using Commons Logging | p. 320 |
| The Java 1.4 Logging API | p. 325 |
| Apache log4j | p. 328 |
| Using log4j with Commons Logging | p. 330 |
| Log Inheritance | p. 334 |
| Logging Performance | p. 337 |
| Logging Best Practices | p. 338 |
| JBoss and log4j | p. 342 |
| Integrating Logging into JavaEdge | p. 343 |
| Logging in the Web Tier | p. 349 |
| Debugging Struts Applications Using JBoss and Eclipse | p. 351 |
| Debugging the JavaEdge Application | p. 353 |
| Hot-Deploy | p. 355 |
| Debugging the Struts Framework | p. 356 |
| Summary | p. 356 |
| Velocity Template Engine | p. 359 |
| What Is a Template Engine? | p. 359 |
| Getting Started | p. 360 |
| Velocity and VelocityContext Classes | p. 362 |
| Velocity Template Language | p. 362 |
| Variables | p. 363 |
| Accessing Variables | p. 363 |
| Variable Values | p. 364 |
| JavaBean Properties | p. 369 |
| Arithmetic | p. 369 |
| Directives | p. 370 |
| Macros | p. 379 |
| Struts and Velocity | p. 381 |
| VelocityTools | p. 381 |
| Struts and Velocity | p. 388 |
| Best Practices for Velocity Use | p. 388 |
| Use Macros | p. 388 |
| Know When to Use #parse and When to Use #include | p. 388 |
| Use JavaBean Property Names | p. 389 |
| Summary | p. 389 |
| Extending the Struts Framework | p. 391 |
| Extending Action and ActionForm | p. 391 |
| Providing Common Services to Your Actions | p. 392 |
| Hooking into the Action Execution | p. 397 |
| Extending RequestProcessor | p. 398 |
| Building a RequestProcessor | p. 399 |
| Using RequestProcessor Instead of Filter | p. 400 |
| Verifying Host Access with RequestProcessor | p. 403 |
| Creating Configuration Beans | p. 403 |
| Building the JavaEdgeActionMapping | p. 404 |
| Revisiting RequestProcessor | p. 405 |
| Building a Plug-In | p. 409 |
| Newsletter Service Basics | p. 410 |
| NewsletterManager | p. 410 |
| NewsletterTask | p. 415 |
| NewsletterPlugIn | p. 416 |
| Configuring the Plug-In | p. 419 |
| Summary | p. 419 |
| Struts and Ajax | p. 421 |
| Ajax Dissected | p. 421 |
| Ajax on Google | p. 422 |
| Ajax on Yahoo | p. 422 |
| Where Should I Use Ajax? | p. 422 |
| Ajax and Web 2.0 | p. 423 |
| Ajax and SOA | p. 423 |
| Ajax Internals | p. 423 |
| Ajax Request-Response Cycle | p. 424 |
| XMLHttpRequest Object | p. 425 |
| Ajax and Struts in Action | p. 426 |
| Cities.jsp | p. 426 |
| GetCitiesNamesAction | p. 429 |
| CitiesDAO | p. 430 |
| Summary | p. 432 |
| JavaEdge Setup and Installation | p. 433 |
| Environment Setup | p. 433 |
| Installing MySQL | p. 433 |
| Installing JBoss | p. 436 |
| Installing Apache Ant | p. 436 |
| Obtaining the JavaEdge Code and Dependencies | p. 437 |
| Installing the JavaEdge Database | p. 437 |
| Building JavaEdge | p. 438 |
| Deploying JavaEdge | p. 439 |
| Summary | p. 440 |
| Struts Development Tools | p. 441 |
| Eclipse | p. 442 |
| Eclipse Summary | p. 444 |
| Eclipse Next Step | p. 444 |
| NetBeans | p. 444 |
| JSP, HTML, XML, and DTD Editors | p. 444 |
| In-Process Tomcat Server | p. 446 |
| NetBeans Summary | p. 446 |
| NetBeans Next Step | p. 447 |
| IBM WebSphere | p. 447 |
| Creating a Struts Project | p. 447 |
| Managing Configuration | p. 448 |
| Creating Actions and ActionForms | p. 449 |
| Web Diagrams | p. 451 |
| WebSphere Summary | p. 451 |
| WebSphere Next Step | p. 452 |
| Borland JBuilder 2006 | p. 452 |
| Web Projects | p. 452 |
| Configuration File Editor | p. 453 |
| JSP Editor | p. 454 |
| UML Designer | p. 454 |
| JavaDoc Preview | p. 454 |
| Action Designer | p. 456 |
| JBuilder Summary | p. 456 |
| JBuilder Next Step | p. 457 |
| Struts Console | p. 457 |
| Getting Started | p. 457 |
| Editing the Struts Configuration File | p. 458 |
| Editing Other Configuration Files | p. 460 |
| Struts Console Summary | p. 460 |
| Struts Console Next Step | p. 461 |
| Exadel Studio | p. 461 |
| Struts Projects | p. 461 |
| Configuration File Editors | p. 461 |
| XML Editor | p. 463 |
| JSP Editor | p. 463 |
| Web Flow Designer | p. 465 |
| Exadel Studio Summary | p. 465 |
| Exadel Studio Next Step | p. 466 |
| XDoclet | p. 466 |
| Apache JMeter | p. 466 |
| Getting Started | p. 466 |
| Features | p. 466 |
| Creating a Sample Test | p. 467 |
| JMeter Summary | p. 470 |
| JMeter Next Step | p. 471 |
| Summary | p. 471 |
| Struts and Strecks | p. 473 |
| Using Strecks | p. 473 |
| @Controller and @ActionInterface | p. 474 |
| @NavigateForward | p. 475 |
| @BindSimple and @ValidateRequired | p. 475 |
| What You Can Do with Strecks | p. 476 |
| Is Strecks for Me? | p. 476 |
| Index | p. 477 |
| Table of Contents provided by Publisher. All Rights Reserved. |
ISBN: 9781590597385
ISBN-10: 1590597389
Series: Expert's Voice in Java
Published: 28th June 2010
Format: Paperback
Language: English
Number of Pages: 530
Audience: Professional and Scholarly
Publisher: Springer Nature B.V.
Country of Publication: US
Dimensions (cm): 22.86 x 17.78 x 3.18
Weight (kg): 0.83
Shipping
| Standard Shipping | Express Shipping | |
|---|---|---|
| Metro postcodes: | $9.99 | $14.95 |
| Regional postcodes: | $9.99 | $14.95 |
| Rural postcodes: | $9.99 | $14.95 |
Orders over $79.00 qualify for free shipping.
How to return your order
At Booktopia, we offer hassle-free returns in accordance with our returns policy. If you wish to return an item, please get in touch with Booktopia Customer Care.
Additional postage charges may be applicable.
Defective items
If there is a problem with any of the items received for your order then the Booktopia Customer Care team is ready to assist you.
For more info please visit our Help Centre.
You Can Find This Book In

Architecture Patterns with Python
Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices
Paperback
RRP $125.75
$60.99
OFF

Learn Python 3 the Hard Way
A Very Simple Introduction to the Terrifyingly Beautiful World of Computers and Code
Paperback
RRP $64.00
$52.99
OFF
This product is categorised by
- Non-FictionComputing & I.T.Graphical & Digital Media ApplicationsWeb Graphics & Design
- Non-FictionComputing & I.T.Computer Networking & CommunicationsNetworking Packages
- Non-FictionComputing & I.T.Computer Programming & Software DevelopmentProgramming & Scripting Languages
- Non-FictionComputing & I.T.Computer Programming & Software DevelopmentSoftware Engineering
- Non-FictionComputing & I.T.Computer Programming & Software DevelopmentWeb Programming
- Non-FictionComputing & I.T.Databases






















