O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Java EE 8 Cookbook

Book Description

A practical guide for building effective enterprise solutions with Java EE 8

About This Book
  • Recipes to get you up-and-running with Java EE 8 application development
  • Learn how to apply the major Java EE 8 APIs and specifications
  • Implement microservices and Reactive programming with Java EE 8
Who 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

What You Will Learn
  • Actionable information on the new features of Java EE 8
  • Using the most important APIs with real and working code
  • Building server side applications, web services, and web applications
  • Deploying and managing your application using the most important Java EE servers
  • Building and deploying microservices using Java EE 8
  • Building Reactive application by joining Java EE APIs and core Java features
  • Moving your application to the cloud using containers
  • Practical ways to improve your projects and career through community involvement
In Detail

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.

Style and approach

Task based learning guide to help ease application development with Java EE.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Java EE 8 Cookbook
  3. Dedication
  4. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  5. Foreword
  6. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Sections
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more…
      5. See also
    5. Get in touch
      1. Reviews
  8. New Features and Improvements
    1. Running your first Bean Validation 2.0 code
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    2. Running your first CDI 2.0 code
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Running your first JAX-RS 2.1 code
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Running your first JSF 2.3 code 
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Running your first JSON-P 1.1 code 
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Running your first JSON-B code 
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    7. Running your first Servlet 4.0 code 
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    8. Running your first Security API code 
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. Running your first MVC 1.0 code 
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  9. Server-Side Development
    1. Using CDI to inject context and dependency
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    2. Using Bean Validation for data validation
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Using servlet for request and response management
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Using Server Push to make objects available beforehand
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Using EJB and JTA for transaction management
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Using EJB to deal with concurrency
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Using JPA for smart data persistence
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    8. Using EJB and JPA for data caching
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. Using batch processing
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  10. Building Powerful Services with JSON and RESTful Features
    1. Building server-side events with JAX-RS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    2. Improving service's capabilities with JAX-RS and CDI
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Easing data and objects representation with JSON-B
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Parsing, generating, transforming, and querying on JSON objects using JSON-P
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  11. Web- and Client-Server Communication
    1. Using servlets for request and response management
      1. Getting ready
      2. How to do it...
        1. The load on startup servlet
        2. A servlet with init params
        3. The asynchronous servlet
      3. How it works...
        1. The load on startup servlet
        2. A servlet with init params
        3. Asynchronous servlet
      4. See also
    2. Building UI with template's features using JSF
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Improving the response performance with Server Push
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  12. Security of Enterprise Architecture
    1. Introduction
    2. Domain protection with authentication
      1. Getting ready
      2. How to do it
      3. How it works...
      4. See also
    3. Granting rights through authorization
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Protecting data confidentiality and integrity with SSL/TLS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Using declarative security
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Using programmatic security
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  13. Reducing the Coding Effort by Relying on Standards
    1. Introduction
    2. Preparing your application to use a connection pool
      1. Getting ready
      2. How to do it...
      3. There's more...
      4. See also
    3. Using messaging services for asynchronous communication
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Understanding a servlet's life cycle
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    5. Transaction management
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  14. Deploying and Managing Applications on Major Java EE Servers
    1. Introduction
    2. Apache TomEE usage
      1. Getting ready
      2. How to do it...
        1. Deploying EAR, WAR, and JAR files
        2. Creating datasources and a connection pool
        3. Logging setup and rotate
        4. Starting and stopping
        5. Session clustering
      3. There's more...
      4. See also
    3. GlassFish usage
      1. Getting ready
      2. How to do it...
        1. Deploying EAR, WAR, and JAR files
        2. Creating datasources and a connection pool
        3. Logging setup and rotate
        4. Starting and stopping
        5. Session clustering
      3. There's more...
      4. See also
    4. WildFly usage
      1. Getting ready
      2. How to do it...
        1. Deploying EAR, WAR, and JAR files
        2. Creating datasources and a connection pool
        3. Logging setup and rotate
        4. Starting and stopping
        5. Session clustering
      3. There's more...
      4. See also
  15. Building Lightweight Solutions Using Microservices
    1. Introduction
    2. Building microservices from a monolith
      1. Getting ready
      2. How to do it...
        1. Building a monolith
        2. Building microservices from the monolith
          1. The user microservice
          2. The user address microservice
          3. The gateway microservice
      3. How it works...
        1. The monolith
        2. The microservices
      4. There's more...
      5. See also
    3. Building decoupled services
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Building an automated pipeline for microservices
      1. Getting ready
        1. Preparing the application
        2. Preparing the environment
      2. How to do it...
        1. Continuous integration
          1. Git
          2. Maven
          3. JUnit
        2. Continuous delivery
        3. Continuous deployment
      3. There's more...
      4. See also
  16. Using Multithreading on Enterprise Context
    1. Introduction
    2. Building asynchronous tasks with returning results
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Using transactions with asynchronous tasks
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Checking the status of asynchronous tasks
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    5. Building managed threads with returning results
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Scheduling asynchronous tasks with returning results
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    7. Using injected proxies for asynchronous tasks
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  17. Using Event-Driven Programming to Build Reactive Applications
    1. Introduction
    2. Building reactive applications using asynchronous servlets
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Building reactive applications using events and observers
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    4. Building reactive applications using websockets
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    5. Building reactive applications using message-driven beans
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    6. Building reactive applications using JAX-RS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    7. Building reactive applications using asynchronous session beans
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    8. Using lambdas and CompletableFuture to improve reactive applications
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
  18. Rising to the Cloud – Java EE, Containers, and Cloud Computing
    1. Introduction
    2. Building Java EE containers using Docker
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    3. Using Oracle Cloud for container orchestration in the cloud
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Using Jelastic for container orchestration in the cloud
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Using OpenShift for container orchestration in the cloud
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Using AWS for container orchestration in the cloud
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  19. Appendix: The Power of Sharing Knowledge
    1. Introduction
    2. Why contributing to the Adopt a JSR program can make you a better professional
      1. Understanding the Adopt a JSR program
      2. Collaborating on the future of Java EE
      3. Setting yourself up for collaboration
        1. Set aside a specific time for it
        2. Choose where you'll concentrate your effort
        3. Do it!
    3. The secret to unstucking your project, your career... even your life!
  20. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think