Migrating Java, Spring, Hibernate, and Maven Java, Spring, Hibernate, and Maven ... Migrating Java,...

Click here to load reader

  • date post

    01-Apr-2018
  • Category

    Documents

  • view

    245
  • download

    5

Embed Size (px)

Transcript of Migrating Java, Spring, Hibernate, and Maven Java, Spring, Hibernate, and Maven ... Migrating Java,...

  • di PisaJava and Flex

    Companion eBook Available

    trim 7.5 x 9.25 spine = 0.84375" 448 page count

    THE EXPERTS VOICE IN WEB DEVELOPMENT

    Beginning

    Java and FlexMigrating Java, Spring, Hibernate, and Maven Developers to Adobe Flex

    Filippo di Pisa

    Learn to build powerful enterprise Java applications using Adobe Flash as the presentation layer

    Beginning

    this print for content onlysize & color not accurate

    CYAN MAGENTA

    YELLOW BLACK PANTONE 123 C

    BOOKS FOR PROFESSIONALS BY PROFESSIONALS

    Filippo di Pisa

    US $46.99

    Shelve in: Programming Languages/Java

    User level: BeginnerIntermediate

    THE APRESS ROADMAP

    Pro Flex on SpringBeginning Java and Flex

    www.apress.comSOURCECODEONLINE

    Companion eBook

    See last page for details

    on $10 eBook version

    ISBN 978-1-4302-2385-6

    9 781430 223856

    54699

    Beginning Java and Flex: Migrating Java, Spring, Hibernate, and Maven Developers to Adobe Flex

    Dear Reader,

    The Adobe Flex Framework has been adopted by the Java community as the preferred framework for Java RIAs development using Flash for the presenta-tion layer. Flex helps Java developers build and maintain expressive web and desktop applications that deploy consistently on most web browsers and a growing number of mobile devices.

    Combining Flex and Java is the new frontier of web development. Spring, Hibernate, and Maven have taken my application development to a higher level, and in this book I show you how these technologies can do the same for your development. With Java and Flash, our applications can be easier to main-tain, build, and test and they are completely portable. And with the release of the FlashPlayer 9 and 10, Adobe has added ActionScript 3, which is now truly object-oriented and offers even better performance in our RIAs.

    I will help you work with these technologies by showing you Flex-Java devel-opment step-by-step, starting with the development environment configura-tion, then moving on to UML design, the Spring development, the Hibernate development, Maven configuration, Flex development, and the BlazeDS server configuration so that you can:

    Discover what Adobe Flex is and how to use it Create amazing client applications based on the FlashPlayer with Flex Learn to use Spring, Hibernate, or Maven with Flex Write more stable Java-based Flex applications and reusable codeAfter reading this book, you will be able to create amazing applications and

    bring a new level of presentation to your Java applications using Flex.

    I hope you enjoy it.Filippo di Pisa

  • Beginning Java and Flex Migrating Java, Spring, Hibernate, and Maven

    Developers to Adobe Flex

    Filippo di Pisa

  • ii

    Begi nning Jav a and F lex: Mi grating Jav a, Spri ng, Hibernate, and Maven Developers to Adobe Flex

    Copyright 2009 by Filippo di Pisa

    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-2385-6

    ISBN-13 (electronic): 978-1-4302-2386-3

    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.

    President and Publisher: Paul Manning Lead Editor: Tom Welsh Technical Reviewer: Bradford Taylor 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

    Project Manager: Debra Kelly Copy Editor: Sharon Terdeman Compositor: Tricia Bronkella Indexer: Ann Rogers and Ron Strauss 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 [email protected], or visit http://www.springeronline.com.

    For information on translations, please 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 SaleseBook 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. A "live" version of the source code is maintained by the author at https://filippodipisa.svn.cvsdude.com/apress_flexjava/archive/. (Username: apressapress, Password: FlexAndJava).

    mailto:[email protected]://www.springeronline.commailto:[email protected]://www.apress.comhttp://www.apress.com/info/bulksaleshttp://www.apress.comhttps://filippodipisa.svn.cvsdude.com/apress_flexjava/archive

  • CONTENTS

    iii

    I dedicate this book to my father, Pino, my mother, Raffaella, my sister, Beatrice, and my wife,

    Soledad, the most important people in my life.

  • iv

    Contents at a Glance

    Contents at a Glance .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv

    Contents .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

    About the Author .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi i

    About the Technical Reviewer .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi i i

    Acknowledgments .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiv

    Introduct ion .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv

    Chapter 1: Developing with Java and Flex .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    Chapter 2: Presenting the Sample Application .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    Chapter 3: Configuring Your Development Environment .. . . . . . . . . . . . . . . . . . 31

    Chapter 4: Inversion of Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    Chapter 5: Spring JDBC and Hibernate .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

    Chapter 6: Spring Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

    Chapter 7: Flex (The View Layer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195

    Chapter 8: Working with Data in F lex .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251

    Chapter 9: B lazeDS ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303

    Chapter 10: Using Flex, Spring, and Hibernate Together .. . . . . . . . . . . . . . . . 353

  • CONTENTS

    v

    Contents

    Contents at a Glance .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv

    Contents .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

    About the Author .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi i

    About the Technical Reviewer .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi i i

    Acknowledgments .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv

    Introduct ion .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv

    Chapter 1: Developing with Java and Flex .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    Why Java?............................................................................................................................................ 1

    Why ActionScript?....................