Archive from March 2023
Payara Monthly Catch: March 2023
Published on 31 Mar 2023
by Priya Khaira-Hanks
Topics:
Microservices,
MicroProfile,
JakartaEE
|
0 Comments
March 2023 Payara Platform Release: Payara 6 Enterprise!
Published on 30 Mar 2023
by Luqman Saeed
Topics:
JakartaEE,
Jakarta EE
|
0 Comments
A lot. Hot out of the Payara engineering furnace, we bring you the latest Payara Platform Community and Enterprise releases for the month of March 2023. Payara Platform Enterprise 6.0 gives you a production optimized and commercially supported runtime for your mission-critical projects, combining our top-rated support and 10 year software lifecycle with the very latest version of Jakarta EE.
Payara Platform Community 6.2023.3 is out with 4 improvements, 6 bug fixes and 3 component upgrades. Payara Platform Enterprise 5.49.0 also comes with 4 bug fixes, 3 component upgrades and 1 improvement.
Payara 6 Enterprise Release - Frequently Asked Questions (FAQs)
Published on 30 Mar 2023
by Luqman Saeed
Topics:
MicroProfile,
JakartaEE,
Payara Enterprise
|
0 Comments
Vulnerability Affecting Server Environments On Java 1.8 on Updates lower than 1.8u191
Published on 28 Mar 2023
by Fabio Turizo
0 Comments
The vulnerability in question is CVE-2023-28462, which was requested directly by Payara.
Using UUID As Entity Primary Key In Jakarta EE 10
Published on 23 Mar 2023
by Luqman Saeed
Topics:
JakartaEE,
Jakarta EE
|
0 Comments
In prior versions of Jakarta EE, the use of UUID as entity ID or database primary key type was a vendor specific feature. So even though you could use it, you had to rely on vendor specific constructs to get the mapping right. With the release of Jakarta EE 10 however, the Jakarta Persistence specification now provides native support for using UUID as entity ID type.
The jakarta.persistence.GenerationType now has a UUID option that indicates to the persistence provider to generate and assign RFC 4122 UUID to the annotated field. The HelloEntity below shows how to use this new feature.
Getting Started With Jakarta EE 10 - Jakarta REST
Published on 21 Mar 2023
by Luqman Saeed
0 Comments
Jakarta EE 10 was released in September of 2022 as the first major release of the venerable Enterprise Java development platform since it was moved to the Eclipse Foundation. As a major release, it did come with a slew of updates to almost all the major specifications, including Jakarta REST. In this blog post, we take a look at how to get started developing RESTful web services on the Jakarta EE Platform using the Jakarta REST API.
Intercepting REST Requests With Jakarta REST Request Filters
Published on 14 Mar 2023
by Luqman Saeed
Topics:
Java EE,
REST,
JakartaEE,
Jakarta EE
|
0 Comments
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.
How to prevent runtime type erasure using GenericEntity in Jakarta REST in Jakarta EE 10
Published on 09 Mar 2023
by Luqman Saeed
Topics:
REST,
JakartaEE,
Java,
Jakarta EE
|
0 Comments
Java generics is a great feature that allows you to have compile time checks for generics. However, due to historical reasons of backward compatibility, type information for generics is erased at runtime. A lot of the time this shouldn’t be of much concern. But there are a few cases where type information is needed at runtime for some kind of decision.
One such situation is in Jakarta REST when the jakarta.ws.rs.core.Response object is used to return a generic collection of a specific type. For example the code below shows the creation and return of a Response object that has a list of HelloEntity as the return payload to the client.
Returning Beautiful Validation Error Messages In Jakarta REST With Exception Mappers
Published on 07 Mar 2023
by Luqman Saeed
Topics:
Java EE,
REST,
JakartaEE,
Jakarta EE
|
2 Comments
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.
Payara Monthly Catch: February 2023
Published on 01 Mar 2023
by Priya Khaira-Hanks
Topics:
Microservices,
MicroProfile,
JakartaEE
|
0 Comments