AWS: Pushing Jakarta EE Full Platform Applications to the Cloud
In this article, readers will learn how to deploy more complex Jakarta EE applications as serverless services with AWS Fargate.
Join the DZone community and get the full member experience.
Join For FreeIn a previous blog post, I demonstrated how to deploy Jakarta EE applications as serverless services with AWS Fargate. The Jakarta EE application I used as an example in the previously mentioned post was a basic one. Now, it's time to go further and see what it takes to do the same thing with more complex Jakarta EE applications involving a wide variety of components like RESTful, CDI, Enterprise Beans, and Server Pages.
Jakarta EE Full Platform is the superset of what has been commonly called "enterprise Java." While not officially coined as a Jakarta EE profile, such as the Core Profile or the Web Profile, the Full Platform includes the whole bunch of the Jakarta EE specifications implementations, from the most essential ones, like Servlet, to the most uncharted ones, like RMI or SAAJ.
In this article, we'll be using Jakarta EE 10 and its implementation by WildFly 27.0.1.Final release.
The Project
The project used in order to illustrate this blog ticket may be found here. It consists of a Maven-based Jakarta EE 10 sample application for items management involving the following components:
- a RESTful 3.1 endpoint that aims at CRUD-ing items;
- a CDI 4.0 component on the domain layer;
- an Enterprise Bean Lite 4.0 component implementing the facade design pattern;
- a Faces 4.0 front-end providing an easy way to test the application.
I tried to carefully choose these components in order to have as much as a reasonable variety of Jakarta EE implementations, such that to justify the deployment of a Full Platform server like WildFly. And while some analysts still think that WildFly, like all the existent Jakarta EE implementations, is a heavy platform, I'll demonstrate how fast and easy it can be deployed on AWS in a Fargate serverless context.
But, before going into infrastructure and deployment considerations, let's first have a detailed analysis of each project's layer.
The Faces 4.0 Front End
Our front-end layer consists of an XHTML-based view using Facelets. As the reader might know, Jakarta EE Faces and JSF (Java Server Faces) were historically used to support two view technologies: JSP (Java Server Pages) and Facelets. The new 4.0 release is deprecating the JSP support, and it adds a new programmatic one based on the jakarta.faces.view.facelets.Facelet
interface. While this new API might be practical for developers who prefer having a pure Java view definition, it always has been considered that a clean software architecture has to separate the business logic from the visual presentation, including using a different declarative notation, like Facelets. That's for this reason that, in this example, I didn't give way to the temptation of using this new Faces API, but I kept using the old good Facelets notation and one of its most useful features: the templating.
The listing below shows the file template.xhtml and the way that it defines our Facelets template: