Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Jakarta EE Cookbook

You're reading from   Jakarta EE Cookbook Practical recipes for enterprise Java developers to deliver large scale applications with Jakarta EE

Arrow left icon
Product type Paperback
Published in May 2020
Publisher Packt
ISBN-13 9781838642884
Length 380 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Elder Moraes Elder Moraes
Author Profile Icon Elder Moraes
Elder Moraes
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. New Features and Improvements 2. Server-Side Development FREE CHAPTER 3. Building Powerful Services with JSON and RESTful Features 4. Web and Client-Server Communication 5. Security of the Enterprise Architecture 6. Reducing Coding Effort by Relying on Standards 7. Deploying and Managing Applications on Major Jakarta EE Servers 8. Building Lightweight Solutions Using Microservices 9. Using Multithreading on Enterprise Context 10. Using Event-Driven Programming to Build Reactive Applications 11. Rising to the Cloud - Jakarta EE, Containers, and Cloud Computing 12. Other Books You May Enjoy Appendix - The Power of Sharing Knowledge

To get the most out of this book

You should be familiar with application development and you need to have at least basic knowledge of Java and Jakarta EE. Basic knowledge of cloud computing and web services is also assumed.

Software/hardware covered in the book

OS requirements

Open JDK 8 or superior

Linux/macOS/Windows

Maven 3.5

Linux/macOS/Windows

Eclipse GlassFish 5.1

Linux/macOS/Windows

Docker CE 18

Linux/macOS/Windows

Git SCM 2.16

Linux/macOS/Windows

If when trying to run any of the code in this book you got a message saying that the "address is already in use" or something like it, you probably have an other service/application using the same port that the example is trying to use. Closing it will fix this issue.

Jakarta EE 9 is on the way – what now?

By the time this second edition is released, we will just be a few months away from the release of Jakarta EE 9! Because of this, you may be wondering, "why not publish the book when 9 is alive and kicking?".

Good question! And the answer is equally clear: because no APIs/features will be changing in this release. So, what's changed that would justify a new release?

Because of one thing in the Jakarta EE field known as big bang. If you've been following Jakarta EE for a while now, you should be aware of it. If not, let me quickly explain it to you.

Due to Java EE being transferred from Oracle to Eclipse Foundation, it was rebranded to Jakarta EE, and due to this, we had the Jakarta EE 8 release. That's why we have the second edition of this book!

As part of the branding and intellectual property process, another thing needed to be changed: the javax namespaces.

The following examples have been taken from this very book, and all of them use the javax namespace:

import javax.ws.rs.core.Application;
import javax.ws.rs.container.AsyncResponse;
import javax.ejb.EJB;
import javax.validation.constraints.Size;

So, all the APIs under Jakarta EE have to change their namespaces from javax to jakarta. This same list in Jakarta EE 9 will look like this:

import jakarta.ws.rs.core.Application;
import jakarta.ws.rs.container.AsyncResponse;
import jakarta.ejb.EJB;
import jakarta.validation.constraints.Size;

Since this book was written to help you deliver the most incredible applications using Jakarta EE 8, I need to answer the following, and most important, question: how does this change affect you and/or your code if you migrate from 8 to 9?

The simple and quick answer is that your code/project will break. Period.

This isn't as bad as it sounds. At the end of the day, Jakarta EE has a huge community of developers around the world (probably one of the biggest communities), and most of them are developers like you that will face these same problems if there's no way out.

So, yes, you'll need to change the imports for all the classes in your project that use the javax namespace. And no, you won't need to do this manually (unless you want to).

While I'm writing this, there is already one tool that is being developed by the Apache Tomcat folks. You can try it out and follow the project for more information at https://github.com/apache/tomcat-jakartaee-migration.

I'm pretty sure that even more tools will become available soon. Stay tuned!

For more information about the big bang, you can read this amazing blog post by Mike Milinkovich: https://eclipse-foundation.blog/2020/01/16/moving-forward-with-jakarta-ee-9/.

Download the example code files

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:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/eldermoraes/javaee8-cookbook. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Then, two key methods from SseResource do their work."

A block of code is set as follows:

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>

Any command-line input or output is written as follows:

Info:   destroy

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "We defined the security rules and roles through our code (the program). There's another approach called declarative security."

Warnings or important notes appear like this.
Tips and tricks appear like this.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image