Pro Web 2.0 Application Development with GWT (Pro)

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Pro Web 2.0 Application Development by Jeff Dwyer is the first book on professional Web 2.0 principles that includes the Google Web Toolkit (GWT). GWT is one of the leading Java Ajax frameworks in market, and his very hot in terms of relative growth; can be integrated with other broader Java frameworks like JBoss Seam and possibly Spring. This book's focus on a single, extremely rich, example “killer application” is the thing that sets this apart from other GWT titles. The author is the Founder and CEO of MyHippocampus, which is a good showpiece of innovative uses of GWT. He is a current practicing Web developer using Web 2.0 and current Ajax principles along with GWT as his framework/toolkit of choice.

Author(s): Jeff Dwyer
Edition: 1
Publisher: Apress
Year: 2008

Language: English
Pages: 480

Pro Web 2.0 Application Development with GWT......Page 1
Contents at a Glance......Page 7
Contents......Page 9
About the Author......Page 19
About the Technical Reviewer......Page 21
Acknowledgments......Page 23
Introduction......Page 25
How This Book Is Structured......Page 26
Downloading the Code......Page 28
Contacting the Author......Page 29
“May You Live in Interesting Times”......Page 33
To HTML or Not to HTML?......Page 34
So What Is GWT?......Page 35
GWT Is Scalable......Page 36
GWT Can Be Refactored......Page 37
Speed......Page 38
Absolute Code Size......Page 39
The Number of Downloads Is Just As Important As Absolute Size......Page 40
Tools, Tools, Tools......Page 41
JavaScript Libraries......Page 42
The Rest of the Stack......Page 43
Maven 2......Page 44
Summary......Page 45
Sample Project Goals......Page 47
GWT Project Structure......Page 48
Client......Page 49
Server......Page 51
Public......Page 52
The GWT Module......Page 53
Sample Calculator Project Code......Page 54
NumberButton.java......Page 55
ControlButton.java......Page 57
Calculator.java (1)......Page 58
ControlAction.java......Page 59
Calculator.java......Page 60
The EntryPoint Class......Page 65
CalcButton: A CSS Enhancement......Page 66
Animation......Page 68
Code Size......Page 70
The Advantages of Compilation......Page 71
Pure Size......Page 72
Summary......Page 74
Designing ToCollege.Net......Page 77
User Story 4: Viewing Schools on a Map......Page 78
My Rankings List......Page 79
Progress Columns......Page 81
My Decision......Page 82
College Browser......Page 83
Forums......Page 84
Using Abstract Property POJOs......Page 85
Application Process Objects......Page 86
The Process Map......Page 87
Revisiting the User’s List of Schools with a Sorted Map......Page 88
Remodeling a Map Association As an Entity Class......Page 90
Summary......Page 91
Why Use Both?......Page 93
Choosing Spring MVC......Page 94
Templating with FreeMarker......Page 96
Splash!......Page 97
Template + Data Model = Output......Page 99
Macros......Page 100
Imports......Page 101
Showing Numbers with myNumber?c......Page 102
Index.ftl and Common.ftl......Page 103
SiteMesh and decorators/default.ftl......Page 104
IndexController.java......Page 110
BasicController.java and the IE 6 Transparent PNG Fix......Page 112
The Dispatcher Servlet......Page 113
Using a Mock for Testing......Page 115
REST-Style URLs in CollegeController.java......Page 116
Basic GWT Integration......Page 120
Modules, Entry Points, and Dictionaries......Page 121
Passing Information with JavaScript Dictionaries......Page 122
Showing a Loading Message......Page 124
ToCollege.Net RPC Integration......Page 125
ToCollegeApp.java......Page 126
ApplicationContext.java......Page 128
Serialization Policy......Page 130
MyPage.java......Page 131
Summary......Page 132
Securing Our Site......Page 133
Acegi Security System......Page 134
Acegi Security Fundamentals......Page 135
Implementing Acegi Security......Page 136
Add a Servlet Filter to web.xml......Page 137
The Filter Chain......Page 138
Processing Authentication......Page 140
Connecting to the User Database......Page 142
The UserDetails Problem......Page 143
Implementing UserDetailsService......Page 145
Storing Passwords......Page 147
Applying URL Security......Page 148
Acegi Security Bean Overview......Page 150
Creating a Login Page in Spring MVC......Page 151
Login Template......Page 152
Getting the Authenticated User in Code......Page 153
OpenID......Page 155
Acegi Security OpenID......Page 156
OpenIDLoginController......Page 157
OpenID Bean Configuration......Page 159
Getting the Current User......Page 160
Logging In from GWT......Page 161
Making Post Requests from GWT......Page 162
Login Service......Page 165
Summary......Page 166
Adding a Database......Page 169
DAOs and the ToCollege.net Architecture......Page 170
GWT-Specific Persistence Concerns......Page 171
Building the DAO Layer......Page 172
Integrating Hibernate......Page 173
Datasource Setup......Page 174
Hibernate SessionFactory......Page 175
Mapping the User Class with User.hbm.xml......Page 178
Hibernate Collections......Page 179
User and Application Database Tables......Page 180
List and List......Page 181
Many-to-Many Relationships......Page 182
Mapping a Map......Page 183
Application.java and Application.hbm.xml......Page 184
Application Tables......Page 185
SchoolDAO......Page 186
The Problem......Page 187
Possible Solutions......Page 188
Filter and Go......Page 189
Attaching HibernateFilter to GWT Serialization......Page 192
What Is the Command Pattern?......Page 194
Easier to Convert to Offline Mode......Page 195
How the Command Pattern Works......Page 196
Implementing Commands......Page 197
SaveRatingCommand.java......Page 198
Updating the Client Objects with AbstractCommand.java......Page 200
ServiceCache.java......Page 201
Testing......Page 202
Testing the DAO Layer......Page 203
UserDAOHibernateImplTest.java......Page 204
Testing the Service Layer......Page 206
SchoolServiceImpl.java......Page 207
Summary......Page 209
ToCollege.net’s GWT GUI......Page 211
Basic My Page GUI Framework......Page 212
Tab Listeners......Page 214
History Management: Repairing the Back Button......Page 215
RPC Status Notification......Page 217
Step 2: Creating a StatusPanel on Bootstrap......Page 220
Step 3: Implement the RPC Notification Strategy (StdAsyncCallback)......Page 221
Step 4: Displaying the Status with StatusPanel......Page 223
Primary and Dependent Styles......Page 226
Step 5: Making It Cool with Fading......Page 227
Drag ’n’ Drop......Page 228
DropController and DragController......Page 230
DragHandler......Page 232
RichTextArea......Page 234
RichTextToolbar’s ImageBundle......Page 236
VerticalLabel......Page 239
Summary......Page 242
The Mashup Landscape......Page 243
Where We’ll Use Maps in ToCollege.net......Page 244
The Google Maps API and Key......Page 246
Module Inheritance and Maps JavaScript......Page 248
A Simple Bulk Geocoder......Page 249
Creating Another Tab......Page 253
Creating a Map Object......Page 254
Loading Schools......Page 255
Making Clickable Markers......Page 256
Why the Dialog Box?......Page 257
Integrating with Spring MVC......Page 258
The GWT Side of CollegeMap......Page 261
Summary......Page 265
A Basic Suggest Box......Page 267
An Ideal Remote Suggest Box......Page 269
Implementing SchoolCompleter......Page 270
SchoolCompleteOracle......Page 273
Adding Highlighting......Page 275
A Basic, SQL LIKE Implementation......Page 277
MySQL Full Text Search......Page 281
Lucene......Page 282
Setting Up Compass Spring Beans......Page 283
Creating Compass Mappings......Page 285
Performing the Search......Page 287
Summary......Page 294
Forums......Page 295
List of Threads......Page 296
Post Display List......Page 297
Reply / Create New Thread......Page 298
History Management and Bookmarkable URLs......Page 299
AbstractForumPost.java......Page 300
Polymorphic ORM with ForumPost.hbm.xml......Page 302
Testing the Mappings with SchoolDAOHibernateTest......Page 304
ForumPost Methods in SchoolDAOHibernateImpl......Page 307
Forum Page Design......Page 310
Controlling the Forums with ForumApp......Page 311
Forum Display......Page 317
CreatePostButton......Page 323
ForumControlPanel......Page 327
TableWithHeaders......Page 328
ExternalLink......Page 329
Having Fun with JSNI......Page 332
Summary......Page 335
Authorization......Page 337
Protecting Our Domain......Page 338
Server Authorization Implementation......Page 339
Remembering Security with Our Guilty Consciences......Page 340
Selects......Page 341
Alternative Access......Page 342
Cross-Site Scripting (XSS)......Page 343
A Sample XSS Attack......Page 344
GWT’s Inherent Protection......Page 345
Analyzing XSS in FreeMarker......Page 346
Securing Ourselves from XSS with Filters......Page 347
Regular Expressions......Page 348
Writing a Sanitization Filter......Page 349
Applying the Sanitization Filter......Page 350
Cross-Site Forged Requests (XSRF)......Page 353
Adding a Client-Side Token......Page 354
Server-Side Token Checking......Page 355
Creating the Server-Side Token......Page 356
Server-Side Token Storage......Page 357
Unit Testing Our XSRF Protection......Page 359
Data Manipulation......Page 360
Out of Order Requests......Page 361
Summary......Page 362
How Search Works......Page 363
Search Engine Optimization (SEO)......Page 364
AJAX and Searching......Page 365
GWT and Searching......Page 366
Optimizing ToCollege.net for Indexing......Page 367
Using Lynx......Page 368
Option 3: Hidden
and