ebook img

Application Development with GWT PDF

480 Pages·2008·5.47 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Application Development with GWT

cyan yelloW maGenTa Black panTone 123 c Books for professionals By professionals® The eXperT’s Voice® in WeB DeVelopmenT Companion eBook Available CCoovveerrss Pro Web 2.0 Application GGWWTT 11..55 Pro Development with GWT Pro W Dear Reader, e This book is for developers who are ready to move beyond small proof-of-concept sample applications and want to look at the issues surrounding a real deploy- b Web 2.0 ment of GWT. If you want to see what the guts of a full-fledged GWT application look like, this is the book for you. 2 GWT 1.5 is a game-changing technology, but it doesn’t exist in a bubble. Real . deployments need to connect to your database, enforce authentication, protect 0 against security threats, and allow good search engine optimization. To show you all this, we’ll look at the code behind a real, live web site called A ToCollege.net. This application specializes in helping students who are applying p Application Development to colleges; it allows them to manage their application processes and compare p the rankings that they give to schools. It’s a slick application that’s ready for you li c to sign up for and use. a This book will give you a walking tour of this modern Web 2.0 start-up’s code- t GWT base. The included source code will provide a functional demonstration of how io to merge together the modern Java stack including Hibernate, Spring Security, n Spring MVC 2.5, SiteMesh, and FreeMarker. This fully functioning application is D with better than treasure if you’re a developer trying to wire GWT into a Maven build e environment who just wants to see some code that makes it work. If a full tour of v 15,000 lines of source code that includes everything from Google Gears integration e to Acegi Security, OpenID, Lucene full-text searching, and Google Maps sounds lo like a good thing, I think you’ll enjoy this book. p m Yours, e Jeff Dwyer n t Learn real-world, professional GWT techniques by w Companion eBook following an in-depth case study of a Web 2.0 site. RelATeD TiTleS i t h G W See last page for details on $10 eBook version T Jeff Dwyer SOURCE CODE ONLINE ISBN-13: 978-1-59059-985-3 D www.apress.com ISBN-10: 1-59059-985-3 w 54499 y e r US $44.99 Shelve in Web Development User level: 9 781590 599853 Intermediate–Advanced this print for content only—size & color not accurate spine = 0.909" 480 page count 9853FM.qxd 4/15/08 11:14 AM Page i Pro Web 2.0 Application Development with GWT Jeff Dwyer 9853FM.qxd 4/15/08 11:14 AM Page ii Pro Web 2.0 Application Development with GWT Copyright © 2008 by Jeff Dwyer 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-985-3 ISBN-10 (pbk): 1-59059-985-3 ISBN-13 (electronic): 978-1-4302-0638-5 ISBN-10 (electronic): 1-4302-0638-1 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 theUS and other countries. Apress, Inc., is not affiliated with Sun Microsystems, Inc., and this book was written without endorsement from Sun Microsystems, Inc. Lead Editors: Steve Anglin, Ben Renow-Clarke Technical Reviewer: Massimo Nardone Editorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, JonathanGennick, Matthew Moodie,Joseph Ottinger, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Project Manager: Kylie Johnston CopyEditor: Heather Lang Associate Production Director: Kari Brooks-Copony Production Editor: Liz Berry Compositor: Dina Quan Proofreader:Linda Marousek Indexer: Carol Burbo Artist: April Milne 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. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precau- tion 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. 9853FM.qxd 4/15/08 11:14 AM Page iii To those who help me realize it’s easier than we think 9853FM.qxd 4/15/08 11:14 AM Page iv 9853FM.qxd 4/15/08 11:14 AM Page v Contents at a Glance About the Author.................................................................xvii About the Technical Reviewer......................................................xix Acknowledgments................................................................xxi Introduction.....................................................................xxiii PART 1 n n n What Can GWT Do for You? nCHAPTER 1 Why GWT?......................................................3 nCHAPTER 2 Getting Started ................................................17 PART 2 n n n ToCollege.net nCHAPTER 3 Designing ToCollege.net .......................................47 nCHAPTER 4 GWT and Spring MVC ..........................................63 nCHAPTER 5 Securing Our Site.............................................103 nCHAPTER 6 Saving Our Work..............................................139 nCHAPTER 7 ToCollege.net’s GWT GUI......................................181 nCHAPTER 8 Google Maps .................................................213 nCHAPTER 9 Suggest Boxes and Full Text Search...........................237 nCHAPTER 10 Forums.......................................................265 nCHAPTER 11 Security and Authorization....................................307 nCHAPTER 12 Search Engine Optimization...................................333 nCHAPTER 13 Google Gears.................................................357 nAPPENDIX Building ToCollege.net........................................391 nINDEX .......................................................................427 v 9853FM.qxd 4/15/08 11:14 AM Page vi 9853FM.qxd 4/15/08 11:14 AM Page vii Contents About the Author.................................................................xvii About the Technical Reviewer......................................................xix Acknowledgments................................................................xxi Introduction.....................................................................xxiii PART 1 n n n What Can GWT Do for You? nCHAPTER 1 Why GWT?....................................................3 “May You Live in Interesting Times”................................3 ToHTML or Not to HTML?.........................................4 So What Is GWT?.................................................5 But JavaScript Is Better Than Java!............................6 Speed......................................................8 Tools,Tools,Tools .........................................11 JavaScript Libraries.........................................12 Community................................................13 The Rest of the Stack .......................................13 Maven 2...................................................14 Summary.......................................................15 nCHAPTER 2 Getting Started..............................................17 Sample Project Goals............................................17 GWT Project Structure ...........................................18 Client .....................................................19 Server ....................................................21 Public.....................................................22 The GWT Module...........................................23 vii 9853FM.qxd 4/15/08 11:14 AM Page viii viii nCONTENTS Sample Calculator Project Code...................................24 NumberButton.java.........................................25 ControlButton.java..........................................27 Calculator.java (1) ..........................................28 ControlAction.java ..........................................29 Calculator.java.............................................30 The EntryPoint Class........................................35 CalcButton:A CSS Enhancement .............................36 Animation......................................................38 Code Size ......................................................40 The Advantages of Compilation...............................41 Pure Size..................................................42 Summary.......................................................44 PART 2 n n n ToCollege.net nCHAPTER 3 Designing ToCollege.net....................................47 User Stories ....................................................48 User Story1:Adding a School................................48 User Story2:Adding Opinions of Schools......................48 User Story3:Sorting Schools into Tiers .......................48 User Story 4:Viewing Schools on a Map.......................48 User Story5:Deciding Among Schools........................49 User Story 6:Managing the Application Process................49 What’s Next................................................49 Overview of ToCollege.net........................................49 My Rankings List...........................................49 My Applications ............................................51 My Decision ...............................................52 Maps .....................................................53 College Browser............................................53 Forums....................................................54

Description:
following an in-depth case study of a Web 2.0 site. Web Logic Security, J2EE Security, LDAP Security, SSO, Apache Security, MS .. emerge from years of ugly Struts code, our traditional MVC, request and .. tion from Practical JavaScript, DOM Scripting, and Ajax Projects, a very good Apress book.
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.