Posts tagged Java EE (3)

How To Consume and Return Data In YAML In Jakarta REST

YAML is a simple, human-friendly data serialization language for all programming languages. It is the main format for working with Docker. As a language agnostic format, there are many bindings for all the major programming languages. You can easily consume and return data in the YAML format in your Jakarta REST application using message body readers and writers.

Intercepting REST Requests With Jakarta REST Request Filters

Oftentimes in web applications, there is the need to intercept a request from the client to resource methods. Sometimes this interception must take place even before the request is matched to a resource method. For such needs, Jakarta REST provides the jakarta.ws.rs.container.ContainerRequestFilter interface. This interface is a Jakarta REST extension that can be used to intercept requests to resource methods. 

An implementation of this interface can decide if requests should be intercepted before they’re matched to resource methods through the @PreMatching annotation. A pre-matched request filter will be invoked by the container before the request is matched to its intended resource method. 

For this blog post, let us look at two use cases for request filters. One is a situation where for security reasons, certain HTTP methods are not allowed. For example an organisation can have a security rule in its firewall that disallows HTTP PUT methods. In this case, either all methods have to be POST or request filters can be used to workaround the restriction. 

The second situation is for the custom implementation of authentication. Of course you absolutely should NOT hand-roll your own security setup unless you know in detail exactly what you are doing. You are better off using tried and tested security frameworks and services out there. But for this blog post, assuming we need to implement custom security, we can use a pre matching request filter. The following code snippet below shows a ContainerRequestFilter implementation that implements the two scenarios above.

Returning Beautiful Validation Error Messages In Jakarta REST With Exception Mappers

All non-trivial enterprise applications have some sort of constraints on the data the application processes. These constraints could range from the simplest to the most complex custom built types. The default validation API on theJakarta EEPlatform, Jakarta Bean Validation has excellent out of the box support for constraining bean fields. Then with its @Valid annotation, you can trigger automatic validation of constrained objects in certain points of an application. 

🔥NoSQL Persistence on The Jakarta EE Platform With Google Firestore🔥

SQL isn't your only option! 
 
Document NoSQL databases store data as document objects, much like JSON objects. Google Firestore is a document database, a NoSQL database offering from Google’s Firebase service. You store your data in documents that are collected into collections.

This guide will introduce you to incorporating Firestore NoSQL database into your Jakarta EE application.

5 Jakarta EE (Formerly Java EE) Myths That Need To Die

The Jakarta EE Platform has come a long way since its debut as J2EE back the days of Sun Microsystems. Over the years, it has had its fair share of challenges. A natural consequence of this is that some notions about the platform arising from some of the past challenges that may have been true about past iterations have stuck. This blog post aims to dispel some of these deeply rooted misconceptions about the Jakarta EE Platform, especially after the last major release.

Webinar Series - What's New in Jakarta EE 10

In September 2022, the Jakarta EE community achieved a huge milestone with Jakarta EE 10 being released (read more here). The key goals of the Jakarta EE 10 release are simplicity, modernization and ensuring it is lightweight. It's been a few months since this major release, so we thought it's a good time now to do a bit of a recap. We invite you to join our series of fast-paced, no slides webinars that will bring you up to speed with Jakarta EE 10!

What's New in the December 2022 Payara Platform Release?

It's the final release of the year and the final release of Payara 5 Community!

Payara Platform Community 6.2022.2 brings 20 component upgrades, 8 bug fixes, 2 security fixes and 4 improvements. Payara Platform Enterprise 5.46.0 brings 45 component upgrades, 13 bug fixes, and 2 security fixes.

Payara Platform Community 5.2022.5 is the final release of the Payara 5 Community stream.

All releases contain a key fix for a vulnerability in web applications deployed as the default module of an instance's virtual server configuration. Read more details below!