Java EE 7 Developer Handbook Develop professional applications in Java EE 7 with this essential reference guide Peter A. Pilgrim BIRMINGHAM - MUMBAI Java EE 7 Developer Handbook Copyright 2013 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: September 2013 Production Reference: 1180913 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 9781849687942 www.packtpub.com Cover Image by Suresh Mogre (suresh.mogre.99@gmail.com) Credits AuthorProject Coordinator Peter A. Pilgrim Gloria Amanna Kranti Berde Reviewers Antonio Gomes Rodrigues Proofreaders Manjeet Singh Sawhney Chrystal Ding Paul Hindle Acquisition Editor Mario Cecere Kevin Colaco Lead Technical EditorIndexers Ritika Dewani Hemangini Bari Joel Noronha Mariammal Chettiyar Rekha Nair Technical Editors Monica Ajmera Mehta Gauri Dasgupta Kapil Hemnani Production Coordinator Monica John Adonia Jones Sonali Verenkar Cover Work Adonia Jones About the Author Peter A.
Pilgrim is the 91st Oracle Java Champion, an independent contractor, a professional software developer and designer. Peter is an honors degree graduate of London South Bank University in 1990. He had already secured a Master's degree course for September 1991, but then instead elected to live and work in Germany for a few years in order to beat off the then, economic recession. He spent productive years at a joint-venture company developing spectroscopic scientific software in Fortran 77, C, Solaris, and X Windows. After four years abroad Peter returned to London and continued his career in the industry with more C, C++, and UNIX development. He then leapt at a chance to get into investment banking with Deutsche Bank in 1998.
It was at Deutsche Bank a week after joining them that Peter discovered Java was the next best thing since sliced bread, when a colleague dropped out of a programming Java training course. As the substitute person, Peter realized this peculiar Java language and platform was the future and the answer. Peter applied his studies to his day job and learnt Java applets, then Java Swing and switched over to the server side with Java Servlets with web applications involving the Struts framework. In 2004, Peter created the JAVAWUG user group in London for the burgeoning development community who were interested in web development on the Java EE. What started as the Struts Networking Users Group in London quickly expanded to lot of other areas. The JAVAWUG ran for six years until 2010.
He built a reputation for travelling to Java technology conferences in the US and Europe and being heavily involved in the wider community. He spoke at several developer conferences including QCon London, ACCU, Devoxx, Devoxx UK, and JavaOne. In 2007, Peter was elected to the Sun Microsystems' Java Champions program. Today, Peter A. Pilgrim is a well-known specialist in Java Enterprise Edition (Java EE) technology, focused on the server-side and the implementation of electronic commerce. Peter has built professional Java EE applications for Blue-chip companies and top-tier investment and retail banks including Lloyds Banking Group, Barclays, UBS, Credit Suisse, Royal Bank of Scotland, and LBi.
He is also a fan of Agile practices and Test Driven Development. Peter, currently, lives in South London with his long-term partner Terry, who is a Scottish Diva, business communication coach, and a singerher voice is phenomenal. Peter writes a blog at http://www.xenonique.co.uk/blog/ and is on Twitter as peter_pilgrim. Acknowledgment I want to send out sincere grateful thanks to all of the reviewers of the book, who pointed out my many egregious errors. Their dedication to the task helped produce this high quality text that you are reading stand out. It is indeed a privilege to have these smart people who will prevent you going out into the public technical literary crowd with egg on your face, due to bad copy and mistaken content.
I say thank you to my external reviewers, Antonio Gomes Rodrigues and Manjeet Singh Sawhney. I want to thank members of the Packt Publishing team including Abhishek Kori, Kevin Colaco, Neha Mallik, Joel Noronha, Gloria Amanna, Ritika Dewani, Kranti Berde, and Kapil Hemnani. All of these folks worked hard to get this text into your hands. Finally, a special thank you goes to Dhwani Devater, who was the acquisition editor that approached me with the book concept and with whom I could not turn down such a challenging project. This book became my personal agenda known as "the project". During the Devoxx UK 2013 conference, I discussed several ideas about Java EE 7 and beyond with David Blewin of Red Hat.
I also met Aslak Knutsen from the Arquillian development team also from Red Hat. I want to thank those of you out in the wider community who saw the earlier presentations about Java EE 7; your feedback helped to derive the best quality for this book. I express gratitude to those followers and interested parties on the social networks of Twitter, Linked-In, Facebook, and Google+, who had kind words to say about writing a technical book. I also want to say a big thank you to Markus Eisele for accepting my invitation to write the foreword for this, my first book. Markus is an excellent enterprise guy who happens to be an Oracle ACE Director and works for Msg in Germany. During 2013, I had a couple of tough months at times and Markus was there in spirit for me valiantly and graciously.
I thank members of the extended Pilgrim family, Mum and Dad and my sister for their support. I wrote this book on a happenstance inquiry from Packt Publishing to help educate software developers, designers, and interested architects in Enterprise Java development. I gladly accepted the commission to write. I sieged this great opportunity. The book become the goal, the goal become "the project". I knew my life would change drastically from the regular software developer to a technical educator.
It did whilst still holding down professional Java contracting gigs. I could not afford to let anyone down. The project became the mission, which was to give developers quality information, demonstrating good practice, and providing fair explanations around the concepts. I wanted to provide clear guidance in this fascinating area of technology. I am sure you have heard the saying about putting back good into the community. Well, this is true for me, too.
Yet I wanted to give more than a return gift. I hoped to engage the worldwide Java community with a product, a concise and worthy Java EE 7 book. This is my first technical book. The project was approximately 15 months in the making to get an initial schedule of promises to the real context of programming, testing and writing content. Emotionally and technically it was tough; I lived the rivers deep and mountains high. Finally, I thank my wonderful Scottish lady, the love of my life, my dear partner, Terry for putting up with me and pushing me on, especially in the early phases of the project, saying several times in broad Glaswegian Patter, "Haud yer wheesht an' get oan wae it!".
Next page