0% found this document useful (0 votes)
900 views

Practical Apache Struts2 Web 2.0 Projects: Ian Roughley

Test

Uploaded by

Pankaj Phukon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
900 views

Practical Apache Struts2 Web 2.0 Projects: Ian Roughley

Test

Uploaded by

Pankaj Phukon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

9039fm.

qxd 10/29/07 3:23 PM Page i

Practical Apache
Struts2 Web 2.0
Projects

Ian Roughley
9039fm.qxd 10/29/07 3:23 PM Page ii

Practical Apache Struts2 Web 2.0 Projects


Copyright © 2007 by Ian Roughley
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-903-7
ISBN-10 (pbk): 1-59059-903-9
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Java™ and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc., in the
US and other countries. Apress, Inc., is not affiliated with Sun Microsystems, Inc., and this book was writ-
ten without endorsement from Sun Microsystems, Inc.
Lead Editor: Steve Anglin
Technical Reviewer: Frank Zammetti
Editorial Board: Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick,
Jason Gilmore, Kevin Goff, Jonathan Hassell, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper,
Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Candace English
Copy Editor: Julie McNamee
Associate Production Director: Kari Brooks-Copony
Production Editor: Candace English
Compositor: Linda Weidemann, Wolf Creek Press
Proofreader: Lisa Hamilton
Indexer: Broccoli Information Management
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected],
or visit http://www.springeronline.com.
For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600,
Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit
http://www.apress.com.
The information in this book is distributed on an “as is” basis, without warranty. Although every pre-
caution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any
liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly
or indirectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com.
9039fm.qxd 10/29/07 3:23 PM Page iii

For Skooter.
9039fm.qxd 10/29/07 3:23 PM Page iv
9039fm.qxd 10/29/07 3:23 PM Page v

Contents at a Glance

Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

■CHAPTER 1 Web 2.0 and Struts2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


■CHAPTER 2 Getting Up and Running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
■CHAPTER 3 Framework Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
■CHAPTER 4 Application Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
■CHAPTER 5 Data Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
■CHAPTER 6 Wizards and Workflows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
■CHAPTER 7 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
■CHAPTER 8 Searching and Listings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
■CHAPTER 9 Syndication and Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
■CHAPTER 10 AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279

■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

v
9039fm.qxd 10/29/07 3:23 PM Page vi
9039fm.qxd 10/29/07 3:23 PM Page vii

Contents

Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

■CHAPTER 1 Web 2.0 and Struts2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


What Is Web 2.0? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Web Application Development 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Web Framework Agility with Struts2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Using this Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

■CHAPTER 2 Getting Up and Running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11


The Build Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Maven2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
The Struts2 Starter Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
The Maven2-Generated Directory and File Structure . . . . . . . . . . . . 15
The Maven2 Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Starter Application Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

■CHAPTER 3 Framework Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37


Walking Through a Request-Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
The Request Initiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
The Struts2 Servlet Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
The Action Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
The Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Interceptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
The Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

vii
9039fm.qxd 10/29/07 3:23 PM Page viii

viii ■CONTENTS

Exploring the Core Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40


Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Interceptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Custom Interceptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
The Value Stack and OGNL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Results and Result Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Tag Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Configuring the Elements of the Framework . . . . . . . . . . . . . . . . . . . . . . . . 52
The web.xml File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Zero Configuration Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
The struts.xml File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Configuring the Execution Environment . . . . . . . . . . . . . . . . . . . . . . . . 65
Extending the Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

■CHAPTER 4 Application Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71


The Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Integration Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
The Domain Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
An Agile Development Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Continuous Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Integrating the Persistence Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Configuring the Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Installing MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Configuring Hibernate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Using Hibernate to Create Data Access Objects . . . . . . . . . . . . . . . . . 85
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

■CHAPTER 5 Data Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89


The Use Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
CRUD Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
The Domain Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Model-Driven Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Setup Code and Data Prepopulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9039fm.qxd 10/29/07 3:23 PM Page ix

■CONTENTS ix

The Action Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98


Single Unit of Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Zero Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Multiple Units of Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
JSP Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Input Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Unexpected Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Changing the Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Recovery via User Interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Displaying the Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
File Uploads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Action Modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
XML-Configured Actions and Wildcard-Configured Actions . . . . . . 144
Zero Configuration Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

■CHAPTER 6 Wizards and Workflows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147


The Use Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
The Scope Interceptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Workflow Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Custom Validations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Customizing the Rendering of Struts2 Tags . . . . . . . . . . . . . . . . . . . 160
Working with Subclassed Domain Objects . . . . . . . . . . . . . . . . . . . . 162
Implementing flash Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Action Validation Using OGNL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
An Alternative Approach to Entering Contestants. . . . . . . . . . . . . . . 171
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

■CHAPTER 7 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179


The Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Container-Based Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Configuring the Container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Configuring the Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Accessing Role Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
The Roles Interceptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
9039fm.qxd 10/29/07 3:23 PM Page x

x ■CONTENTS

Implementing Acegi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187


Configuring Acegi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
The Acegi Application Context Configuration File. . . . . . . . . . . . . . . 189
Implementing a Custom Authentication Provider . . . . . . . . . . . . . . . 191
Authenticating the User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Accessing Role Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Custom Authentication and Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Preventing Unauthorized Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Configuring Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Implementing Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Accessing Role Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

■CHAPTER 8 Searching and Listings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209


The Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Setting the Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Updating the Screen Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Creating a Friendly Home Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Modularizing the List Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Search for Events by Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Developing a Search Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Consolidating List Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

■CHAPTER 9 Syndication and Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237


The Use Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Implementing RSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Results and Result Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Configuring Result Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Implementing the RSS Result Type . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Implementing an Atom Feed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Consuming the RSS Feed with a Mashup . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Configuring the GeoRSS Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Geo-coding the Address and Creating the Feed Entry. . . . . . . . . . . 251
Implementing the Mashup Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Integrating a Map into the Home Page. . . . . . . . . . . . . . . . . . . . . . . . 260
9039fm.qxd 10/29/07 3:23 PM Page xi

■CONTENTS xi

Implementing Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262


Mapping URLs to Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Configuring Action Mappers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Creating a Custom Action Mapper . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Implementing the RESTful Web Service Logic . . . . . . . . . . . . . . . . . 271
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277

■CHAPTER 10 AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279


The Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Developing the Supporting Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Updating the Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Implementing the Voting Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Using the ajax Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Configuring the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Retrieving Action Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Invoking Actions as Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Additional ajax Theme Opportunities . . . . . . . . . . . . . . . . . . . . . . . . 299
Using JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Using the XML Result Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Using the JSON Result Type Plug-in. . . . . . . . . . . . . . . . . . . . . . . . . . 310
Using the Google Web Toolkit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Generating the GWT Starter Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Configuring the Struts2 Plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Integrating Struts2 and GWT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326

■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

You might also like