Bắt đầu từ ™ Java App Engine của Google Dear Reader, Điện toán đám mây đang trở thành một mô hình được lựa chọn cho nhiều nhà phát triển như chính mình. Cuốn sách này cung cấp cho bạn những chìa khóa cho Google App Engine, mà là một nền tảng đám mây lớn cho JavaTM. Chúng tôi sẽ chỉ cho bạn tất cả các thành phần cốt lõi của SDK, nền tảng, và các dịch vụ mà Google cung cấp - các yếu tố cần thiết để xây dựng một ứng dụng web trên App Engine....
CYAN MAGENTA YELLOW BLACK PANTONE 123 C Books for professionals by professionals ® EXPERT’s VOIce ® in Cloud Computing Companion eBook Available FPO Beginning Java™ Google App Engine Beginning Dear Reader, Beginning Cloud computing is becoming a model of choice for many developers like yourself This book gives you the keys to Google App Engine, which is a major Cloud platform for JavaTM We’ll show you all the core components of the SDK, the platform, and the services that Google provides – the essentials for building a web application on App Engine You'll learn how to put App Engine to work quickly, starting with the Google Plugin for Eclipse and moving on to the development server, the datastore, Java Data Objects (JDO), and Persistence as a Service Then we'll show you how to use Spring as a Service for transaction, data access, and more You'll see how you can create Ajax applications with Google Web Toolkit, and how to build Web apps that even integrate with Salesforce.com and Google Wave And once your app is up and running, you'll learn how to monitor, manage, and maintain it Beginning Java™ Google App Engine gives you a complete guided tour of Google App Engine Once you’ve read this book, you’ll be able to implement your next big project with this exciting new platform, with the knowledge and skills you’ve gained from this book as your foundation Kyle Roche Jeff Douglas Java Google App Engine ™ Kyle Roche and Jeff Douglas THE APRESS ROADMAP Companion eBook See last page for details on $10 eBook version Beginning Java™ EE Platform with GlassFish™ Beginning Java Google App Engine Pro Scala Beginning Groovy and Grails The Definitive Guide to Grails, Second Edition Pro Hadoop Beginning Scala The Definitive Guide to Lift: A Scala-based Web Framework TM www.apress.com ISBN 978-1-4302-2553-9 44 9 US $44.99 Roche Douglas SOURCE CODE ONLINE Learn about the core components of the Google App Engine SDK, platform, and services for web developers using JavaTM technology Kyle Roche and Jeff Douglas Shelve in: Web Development / Programming Languages / Java User level: Beginner to Intermediate 781430 225539 this print for content only—size & color not accurate 7.5 x 9.25 spine = x.xxx" xxx page count CYAN MAGENTA YELLOW BLACK PANTONE 123 C ooks for professionals by professionals ® FPO ERT’s VOIce ® in Cloud Computi Beginning Java™ Google App Engine Dear Reader, Cloud computing is becoming a model of choice for many developers like yourself This book gives you the keys to Google App Engine, which is a major Cloud platform for JavaTM We’ll show you all the core components of the SDK, the platform, and the services that Google provides – the essentials for building a web application on App Engine You'll learn how to put App Engine to work quickly, starting with the Google Plugin for Eclipse and moving on to the development server, the datastore, Java Data Objects (JDO), and Persistence as a Service Then we'll show you how to use Spring as a Service for transaction, data access, and more You'll see how you can create Ajax applications with Google Web Toolkit, and how to build Web apps that even integrate with Salesforce.com and Google Wave And once your app is up and running, you'll learn how to monitor, manage, and maintain it Beginning Java™ Google App Engine gives you a complete guided tour of Google App Engine Once you’ve read this book, you’ll be able to implement your next big project with this exciting new platform, with the knowledge and skills you’ve gained from this book as your foundation Kyle Roche Jeff Douglas Kyle Roche and Jeff Douglas THE APRESS ROADMAP Companion eBook See last page for details on $10 eBook version Beginning Java™ EE Platform with GlassFish™ Beginning Java Google App Engine Pro Scala Beginning Groovy and Grails The Definitive Guide to Grails, Second Edition Pro Hadoop Beginning Scala The Definitive Guide to Lift: A Scala-based Web Framework TM SOURCE CODE ONLINE www.apress.com US $44.99 Shelve in: Web Development / Programming Languages / Java User level: Beginner to Intermediate this print for content only—size & color not accurate 7.5 x 9.25 spine = x.xxx" xxx page count ™ Beginning Java Google App Engine ■■■ Kyle Roche Jeff Douglas ™ Beginning Java Google App Engine Copyright © 2009 by Kyle Roche and Jeff Douglas 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-4302-2553-9 ISBN-13 (electronic): 978-1-4302-2554-6 Printed and bound in the United States of America 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 President and Publisher: Paul Manning Lead Editor: Steve Anglin Developmental Editor: Tom Welsh Technical Reviewer: Kunal Mittal Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Kelly Moritz Copy Editor: Jill Steinberg Composition: ContentWorks, Inc Indexer: BIM Indexing & Proofreading Services Artist: April Milne Cover Designer: Anna Ishchenko 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 orders-ny@springer-sbm.com, or visit http://www.springeronline.com For information on translations, please e-mail info@apress.com, 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 precaution 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 You will need to answer questions pertaining to this book in order to successfully download the code There’s an Irish saying no man can prosper without his woman’s leave —KR To Cathy, who has touched not only my heart, but the hearts of so many that will never remember her I love you —JD Contents at a Glance Foreword xiii About the Authors xv About the Technical Reviewer xvii Acknowledgments xix Introduction xxi Chapter 1: Beginning Google App Engine for Java Chapter 2: Introduction to App Engine .7 Chapter 3: Getting Started with Google App Engine for Java 25 Chapter 4: Servlet Container and Frameworks 43 Chapter 5: Developing Your Application 89 Chapter 6: Authenticating Users 123 Chapter 7: Using the App Engine Datastore 135 Chapter 8: App Engine Services .169 Chapter 9: Administration and Integration 197 Index .221 v vi Contents Foreword xiii About the Authors xv About the Technical Reviewer xvii Acknowledgments xix Introduction xxi Chapter 1: Beginning Google App Engine for Java Cloud Computing and App Engine Find More Time to Innovate What You’ll Learn in This Book Summary Chapter 2: Introduction to App Engine .7 App Engine Architecture Being a Good Neighbor With Quotas Billable and Fixed Quotas 10 Detailed Resource Quotas 12 Components of an App Engine Application 22 Summary 23 Chapter 3: Getting Started with Google App Engine for Java 25 Where Do We Start? 25 Create Your First App Engine Project 30 Local Development Server 37 Summary 42 vii ■ CONTENTS Chapter 4: Servlet Container and Frameworks 43 Choosing a Framework 43 Servlets and JavaServer Pages 46 Views 46 Model 59 Controller 64 Deployment Descriptor 69 PersistenceManager 69 Spring MVC 70 Server Configuration 71 Views 72 Adobe Flex 74 Server Configuration 76 Client-Side Code 79 Server-Side Code 83 Summary 88 Chapter 5: Developing Your Application 89 Functional Specifications 89 Timecard UI Mock-up 90 Technical Specifications 91 Authentication 91 Presentation 91 Persistence 92 Using Google Web Toolkit 92 Creating Your Project 93 Running the Initial Starter Application 96 Developing Your Application 97 Required Imports 101 Coding Your UI 102 viii ... retrieval system, without the prior written permission of the copyright owner and the publisher ISBN -1 3 (pbk): 97 8 -1 -4 30 2-2 55 3-9 ISBN -1 3 (electronic): 97 8 -1 -4 30 2-2 55 4-6 Printed and bound in the United... York, NY 10 013 Phone 1- 8 00-SPRINGER, fax 20 1- 3 4 8-4 505, e-mail orders-ny@springer-sbm.com, or visit http://www.springeronline.com For information on translations, please e-mail info @apress. com,... xxi Chapter 1: Beginning Google App Engine for Java Chapter 2: Introduction to App Engine .7 Chapter 3: Getting Started with Google App Engine for Java 25 Chapter 4: Servlet