32,99 €
A practical guide for building effective enterprise solutions with Java EE 8
Key FeaturesRecipes to get you up-and-running with Java EE 8 application development Learn how to apply the major Java EE 8 APIs and specificationsImplement microservices and Reactive programming with Java EE 8Book Description
Java EE is a collection of technologies and APIs to support Enterprise Application development. The choice of what to use and when can be dauntingly complex for any developer. This book will help you master this. Packed with easy to follow recipes, this is your guide to becoming productive with Java EE 8.
You will begin by seeing the latest features of Java EE 8, including major Java EE 8 APIs and specifications such as JSF 2.3, and CDI 2.0, and what they mean for you.
You will use the new features of Java EE 8 to implement web-based services for your client applications. You will then learn to process the Model and Streaming APIs using JSON-P and JSON-B and will learn to use the Java Lambdas support offered in JSON-P. There are more recipes to fine-tune your RESTful development, and you will learn about the Reactive enhancements offered by the JAX-RS 2.1 specification.
Later on, you will learn about the role of multithreading in your enterprise applications and how to integrate them for transaction handling. This is followed by implementing microservices with Java EE and the advancements made by Java EE for cloud computing.
The final set of recipes shows you how take advantage of the latest security features and authenticate your enterprise application.
At the end of the book, the Appendix shows you how knowledge sharing can change your career and your life.
What you will learnActionable information on the new features of Java EE 8Using the most important APIs with real and working codeBuilding server side applications, web services, and web applicationsDeploying and managing your application using the most important Java EE serversBuilding and deploying microservices using Java EE 8Building Reactive application by joining Java EE APIs and core Java featuresMoving your application to the cloud using containersPractical ways to improve your projects and career through community involvementWho this book is for
This book is for developers who want to become proficient with Java EE 8 for their enterprise application development. Basic knowledge of Java is assumed
Elder Moraes helps Java EE developers build and deliver secure, fast, and available applications, so they can work on great projects. Passionate about content sharing, he speaks at international events and blogs. Working with Java since 2002, Elder has developed applications for various industries. A board member at SouJava, he led the "Java EE 8 - The Next Frontier" initiative. He lives in Brazil with his wife, Erica, and his daughter, Rebeca.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 258
Veröffentlichungsjahr: 2018
Copyright © 2018 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 or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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.
Commissioning Editor:Merint MathewAcquisition Editor: Isha RavalContent Development Editor: Jason PereiraTechnical Editor: Prajakta MhatreCopy Editor: Safis EditingProject Coordinator: Sheejal ShahProofreader: Safis EditingIndexer: Mariammal ChettiyarProduction Coordinator: Deepika Naik
First published: April 2018 Production reference: 1060418
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78829-303-7
www.packtpub.com
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
It is a measure of the penetration, longevity, and quality of Java EE technology that in 2018 my friend Elder Moraes asked me to write the foreword for his book about Java EE 8. My personal involvement with Java EE goes back to the days preceding J2EE 1.4 in 2001. Since then, I have had the great honor of leading or co-leading the community teams that have developed JavaServer Faces and, later, servlet, two of the technologies Elder covers in this book. During that time, I tried to follow the model of servant-leader, and I think the result has been a very engaged community that has a real stake in the continued success of Java EE.When writing this foreword, I want to focus on four Cs: Curation, Cohesion, Current, and Completeness. So much has been written about Java EE over the years, and continues to be written, that the task of writing a book, particularly one in the useful "cookbook" format, involves a lot of curation. From the set of all possible things that people are doing with Java EE, which is vast, Elder has presented a curation of what he thinks are the most useful and essential ones. Elder is well positioned to decide what goes in and what stays out. Elder has been consulting and working with Java EE for nearly as long as I have, but from the more practical perspective of the user. Technical books that follow the cookbook pattern frequently suffer from a feeling of disjointness. Not this book. Elder has put a great deal of effort into ensuring cohesion. Over the years, the technologies of Java EE have sometimes been criticized for not being cohesive enough with each other. This is something Sun made a conscious effort to address starting with Java EE 6, and which Oracle continued on to Java EE 8. Elder has leveraged this effort to seek out and present the best way to leverage the synergy of all the technologies of Java EE 8 to maximum effect.The world outside Java EE has continued to evolve, and this has changed the way people use Java EE dramatically. The challenge for any architect on a multiyear software effort, with a service lifetime of at least a decade, is how to keep it maintainable even while the surrounding technology landscape changes. Elder has accounted for this with two excellent chapters about microservices and Docker. These two technologies provide a great complement to the power of Java EE, but also have numerous pitfalls. Elder helps you avoid the pitfalls while getting the most out of these current trends.
Finally, completeness. Many technology cookbooks stop short of providing "complete reference" sort of material, but Elder goes much deeper. It's almost to the point that the term "cookbook" does not do this book justice. Perhaps, a more correct label would be "complete restaurant management with supply chain logistics and a cookbook on top." Elder covers the current popular app servers on which people are running Java EE, continuous integration and pipelines, reactive programming, and more. Coming back to the curation point, it's all there, and in depth.
I hope you have success with Java EE and with its successor, Jakarta EE from the Eclipse Foundation.
Ed Burns
Consulting Member of Technical Staff at Oracle
Specification Lead of JSF and Servlet
Elder Moraes helps Java EE developers build and deliver secure, fast, and available applications so that they are able to work on great projects. He is passionate about content sharing; he does it by speaking at international events, blogging, and writing articles. He has been working with Java since 2002 and has developed applications for different industries. As a board member at SouJava, he led the Java EE 8 - The Next Frontier initiative, interviewing some of the world class Java EE experts.
Romain Manni Bucau is a senior software engineer who has been involved in Java EE and more particularly Apache projects as a committer (Apache TomEE, OpenWebBeans, Johnzon, BatchEE, OpenJPA, BVal, Meecrowave, and many more) since 2011. He also wrote JavaEE 8 High Performance for Packt. He now works at Talend on Big Data and API projects. You can follow him on Twitter at @rmannibucau or on his blog at rmannibucau.metawerx.net.
Omar El-Prince is an experienced software engineer with a computer engineering graduate degree and master's degree in computer science from Johns Hopkins University. He has wide experience on working in large Java EE projects at CSRA, Booz Allen Hamilton, HP, EDS, and other companies. He enjoys programming and technology blogging, focused on agile culture, software development, and architecture. He is Java EE enthusiastic and loves learning, mentoring, and helping others.
Bauke Scholtz is an Oracle Java champion and the main creator of the award-winning JSF helper library OmniFaces. On the internet, he is more commonly known as BalusC, who is among the top contributors on Stack Overflow. He is a web application specialist and consults for clients from fintech, affiliate marketing, social media, and more as part of his 17 years of experience. Bauke has previously reviewed Mastering OmniFaces and wrote The Definitive Guide to JSF in Java EE 8.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Title Page
Copyright and Credits
Java EE 8 Cookbook
Dedication
Packt Upsell
Why subscribe?
PacktPub.com
Foreword
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Sections
Getting ready
How to do it...
How it works...
There's more…
See also
Get in touch
Reviews
New Features and Improvements
Running your first Bean Validation 2.0 code
Getting ready
How to do it...
How it works...
See also
Running your first CDI 2.0 code
Getting ready
How to do it...
How it works...
There's more...
See also
Running your first JAX-RS 2.1 code
Getting ready
How to do it...
How it works...
See also
Running your first JSF 2.3 code 
Getting ready
How to do it...
How it works...
There's more...
See also
Running your first JSON-P 1.1 code 
Getting ready
How to do it...
How it works...
See also
Running your first JSON-B code 
Getting ready
How to do it...
How it works...
See also
Running your first Servlet 4.0 code 
Getting ready
How to do it...
How it works...
There's more...
See also
Running your first Security API code 
Getting ready
How to do it...
How it works...
There's more...
See also
Running your first MVC 1.0 code 
Getting ready
How to do it...
How it works...
See also
Server-Side Development
Using CDI to inject context and dependency
Getting ready
How to do it...
How it works...
There's more...
See also
Using Bean Validation for data validation
Getting ready
How to do it...
How it works...
See also
Using servlet for request and response management
Getting ready
How to do it...
How it works...
There's more...
See also
Using Server Push to make objects available beforehand
Getting ready
How to do it...
How it works...
There's more...
See also
Using EJB and JTA for transaction management
Getting ready
How to do it...
How it works...
There's more...
See also
Using EJB to deal with concurrency
Getting ready
How to do it...
How it works...
There's more...
See also
Using JPA for smart data persistence
Getting ready
How to do it...
How it works...
See also
Using EJB and JPA for data caching
Getting ready
How to do it...
How it works...
There's more...
See also
Using batch processing
Getting ready
How to do it...
How it works...
See also
Building Powerful Services with JSON and RESTful Features
Building server-side events with JAX-RS
Getting ready
How to do it...
How it works...
There's more...
See also
Improving service's capabilities with JAX-RS and CDI
Getting ready
How to do it...
How it works...
There's more...
See also
Easing data and objects representation with JSON-B
Getting ready
How to do it...
How it works...
See also
Parsing, generating, transforming, and querying on JSON objects using JSON-P
Getting ready
How to do it...
How it works...
See also
Web- and Client-Server Communication
Using servlets for request and response management
Getting ready
How to do it...
The load on startup servlet
A servlet with init params
The asynchronous servlet
How it works...
The load on startup servlet
A servlet with init params
Asynchronous servlet
See also
Building UI with template's features using JSF
Getting ready
How to do it...
How it works...
See also
Improving the response performance with Server Push
Getting ready
How to do it...
How it works...
There's more...
See also
Security of Enterprise Architecture
Introduction
Domain protection with authentication
Getting ready
How to do it
How it works...
See also
Granting rights through authorization
Getting ready
How to do it...
How it works...
See also
Protecting data confidentiality and integrity with SSL/TLS
Getting ready
How to do it...
How it works...
There's more...
See also
Using declarative security
Getting ready
How to do it...
How it works...
See also
Using programmatic security
Getting ready
How to do it...
How it works...
See also
Reducing the Coding Effort by Relying on Standards
Introduction
Preparing your application to use a connection pool
Getting ready
How to do it...
There's more...
See also
Using messaging services for asynchronous communication
Getting ready
How to do it...
How it works...
See also
Understanding a servlet's life cycle
Getting ready
How to do it...
How it works...
See also
Transaction management
Getting ready
How to do it...
How it works...
See also
Deploying and Managing Applications on Major Java EE Servers
Introduction
Apache TomEE usage
Getting ready
How to do it...
Deploying EAR, WAR, and JAR files
Creating datasources and a connection pool
Logging setup and rotate
Starting and stopping
Session clustering
There's more...
See also
GlassFish usage
Getting ready
How to do it...
Deploying EAR, WAR, and JAR files
Creating datasources and a connection pool
Logging setup and rotate
Starting and stopping
Session clustering
There's more...
See also
WildFly usage
Getting ready
How to do it...
Deploying EAR, WAR, and JAR files
Creating datasources and a connection pool
Logging setup and rotate
Starting and stopping
Session clustering
There's more...
See also
Building Lightweight Solutions Using Microservices
Introduction
Building microservices from a monolith
Getting ready
How to do it...
Building a monolith
Building microservices from the monolith
The user microservice
The user address microservice
The gateway microservice
How it works...
The monolith
The microservices
There's more...
See also
Building decoupled services
Getting ready
How to do it...
How it works...
See also
Building an automated pipeline for microservices
Getting ready
Preparing the application
Preparing the environment
How to do it...
Continuous integration
Git
Maven
JUnit
Continuous delivery
Continuous deployment
There's more...
See also
Using Multithreading on Enterprise Context
Introduction
Building asynchronous tasks with returning results
Getting ready
How to do it...
How it works...
See also
Using transactions with asynchronous tasks
Getting ready
How to do it...
How it works...
See also
Checking the status of asynchronous tasks
Getting ready
How to do it...
How it works...
See also
Building managed threads with returning results
Getting ready
How to do it...
How it works...
See also
Scheduling asynchronous tasks with returning results
Getting ready
How to do it...
How it works...
See also
Using injected proxies for asynchronous tasks
Getting ready
How to do it...
How it works...
See also
Using Event-Driven Programming to Build Reactive Applications
Introduction
Building reactive applications using asynchronous servlets
Getting ready
How to do it...
How it works...
See also
Building reactive applications using events and observers
Getting ready
How to do it...
How it works...
See also
Building reactive applications using websockets
Getting ready
How to do it...
How it works...
See also
Building reactive applications using message-driven beans
Getting ready
How to do it...
How it works...
See also
Building reactive applications using JAX-RS
Getting ready
How to do it...
How it works...
See also
Building reactive applications using asynchronous session beans
Getting ready
How to do it...
How it works...
See also
Using lambdas and CompletableFuture to improve reactive applications
Getting ready
How to do it...
How it works...
See also
Rising to the Cloud – Java EE, Containers, and Cloud Computing
Introduction
Building Java EE containers using Docker
Getting ready
How to do it...
How it works...
See also
Using Oracle Cloud for container orchestration in the cloud
Getting ready
How to do it...
How it works...
There's more...
Using Jelastic for container orchestration in the cloud
Getting ready
How to do it...
How it works...
There's more...
Using OpenShift for container orchestration in the cloud
Getting ready
How to do it...
How it works...
There's more...
See also
Using AWS for container orchestration in the cloud
Getting ready
How to do it...
How it works...
There's more...
Appendix: The Power of Sharing Knowledge
Introduction
Why contributing to the Adopt a JSR program can make you a better professional
Understanding the Adopt a JSR program
Collaborating on the future of Java EE
Setting yourself up for collaboration
Set aside a specific time for it
Choose where you'll concentrate your effort
Do it!
The secret to unstucking your project, your career... even your life!
Other Books You May Enjoy
Leave a review - let other readers know what you think
Java EE is a mature platform that's widely used around the world. It is also a standard that has evolved through the hard work of individuals, vendors, groups leaders, and communities. It has a whole market and ecosystem around it, with millions of users, which also means a big and active community that is always willing to help it move forward.
For those reasons, the purpose of this book is to meet the needs of those professionals who depend on Java EE to deliver really awesome enterprise solutions, not only talking about real solutions for real problems, but also showing how to do it in a practical way.
The book starts with a quick overview of what Java EE and the improvements in version 8. Then, it takes you on a hands-on journey through the most important APIs.
You will learn how to use Java EE for server-side development, web services, and web applications. You will also take a look at how you can properly improve the security of your enterprise solutions.
No Java EE application is good enough if it doesn't follow the standards, and for that, you can count on the Java EE application servers. This book will teach you how to use the most important servers on the market and take the best they have to offer for your project.
From an architectural point of view, the book will cover microservices, cloud computing, and containers. Also, it will not forget to give you all tools for building a reactive Java EE application using not only Java EE features, but also Java core features such as lambdas and completable future.
The whole Java world is all about the community, so we will also show you how community-driven professionals can improve the results of their projects and even go to higher levels in their careers.
The book was based on a concept that I call "The Five Mistakes That Keep Java EE Professionals Away From Great Projects." I am ruining my career when I don't do the following things:
Keep myself up to date
Know the APIs (an overview of all of them and master the most important ones)
Know the most commonaly used Java EE application servers
Know advanced architectures
Share what I know
So, the book is a straight, practical, and helpful solution to each one of these mistakes. I can say with confidence that dealing with them properly can change the careers and lives of many developers around the world. I know because they've changed mine, for good.
This book is made for developers who would like to learn how to meet real enterprise application needs using Java EE 8. They should be familiar with application development and need to have knowledge of least basic Java, the basic concepts of cloud computing, and web services.
The readers should want to learn how to combine a bunch of APIs in a secure and fast solution, and for this, they need to know how the APIs work and when to use each one.
Chapter 1, New Features and Improvements, explains the main changes to the Java EE 8 specification and what the reader can do with them. It also shows the new features and briefly explores the benefits of them. All these topics are supported by code examples.
Chapter 2, Server-Side Development, deep dives into the most important APIs and most commonly used features for server-side development. The readers here will go through real recipes for solving real problems.
Chapter 3, Building Powerful Services with JSON and RESTful Features, creates web services for different enterprise scenarios. Readers will go deep into the JAX-RS, JSON-P, and JSON-B APIs.
Chapter 4, Web- and Client-Server Communication, deals with the communication generated by web applications in a fast and reliable way using the latest Java EE 8 features, such as HTTP2 and Server Push.
Chapter 5, Security of Enterprise Architecture, gives the readers information on the tools using the best Java EE features to create secure architectures.
Chapter 6, Reducing the Coding Effort by Relying on Standards, describes the services and features that Java EE application servers give to the applications they host. Those features not only let the readers rely on a standard and build their application based on it, but also allow them to write less code, as they don't need to implement features that have been already implemented by the server.
Chapter 7, Deploying and Managing Applications on Major Java EE Servers, describes the use of each of the most commonly used Java EE application servers on the market, giving special attention to the way you deploy and manage them.
Chapter 8, Building Lightweight Solutions Using Microservices, makes you understand how microservice architectures work and how readers can easily use Java EE 8 to build microservice and/or break down their monoliths in order to implement this paradigm.
Continuous Delivery and Continuous Deployment are also described, as no successful microservice project is complete without a mature building and deployment process.
Chapter 9, Using Multithreading on Enterprise Context, describes the use of multithreading and concurrency when building enterprise applications.
Chapter 10, Using Event-Driven Programming to Build Reactive Applications, describes the use of Java EE 8 and core Java to create low-latency, efficient, and high-throughput applications.
Chapter 11, Rising to the Cloud – Java EE, Containers, and Cloud Computing, describes how to combine Java EE and containers to run applications on the cloud.
Appendix, The Power of Sharing Knowledge, describes how the community is vital for the whole Java EE ecosystem (even if readers don't know about it) and how they can improve their own daily work by joining the Adopt a JSR initiative.
It also describes how sharing knowledge is a powerful tool for improving their careers and what it has to do with Java EE (and it has everything to do with Java EE!).
Readers should be familiar with application development and need to have at least basic knowledge of Java. Basic knowledge of cloud computing and web services are also assumed.
You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at
www.packtpub.com
.
Select the
SUPPORT
tab.
Click on
Code Downloads & Errata
.
Enter the name of the book in the
Search
box and follow the onscreen instructions.
