JAX-RS.next and Reactive Jersey Client – Slides from CZJUG presentations

Yesterday I was given the opportunity to speak at our local Java User Group meeting (CZJUG). I was covering two topics – JAX-RS.next and Reactive Jersey Client. In this post I’d like to share the used slide-decks and some additional resources.

Continue reading JAX-RS.next and Reactive Jersey Client – Slides from CZJUG presentations

Intercepting Jersey resource method calls

Sometimes it would be nice to have a possibility to wrap a resource method call. Imagine a use-case in which you need to process business code, placed in your resource method, in a transaction (open transaction before resource method, commit or rollback transaction at the end) or apply some advanced security constraints. If you’re using JAX-RS together with CDI in your application it’s not a problem to do such things. Fortunately, with Jersey it’s also possible to do those things outside of CDI.

Continue reading Intercepting Jersey resource method calls

Jersey 2.15 is released

We have released Jersey 2.15 – Reference Implementation of JAX-RS 2.0 (Java API for RESTful Web Services). The JAX-RS 2.0 specification is available at the JCP web site.

In this article I’d like to introduce some of the new features, important bug fixes and other noteworthy changes.

Continue reading Jersey 2.15 is released

Reactive Jersey Client, Part 2 – Usage and Supported Libraries

Reactive Jersey Client API is a generic API allowing end users to utilize the popular reactive programming model when using Jersey Client. This part of the series describes API, usage and lists all supported reactive libraries.

Continue reading Reactive Jersey Client, Part 2 – Usage and Supported Libraries

Jersey 2.6 has been Released: New and Noteworthy

As some of you may have already noticed, we’ve recently released Jersey 2.6 (Reference Implementation of JAX-RS – Java API for RESTful Web Services). In this article I’d like to introduce some of the new features, important bug fixes and other noteworthy changes.

Continue reading Jersey 2.6 has been Released: New and Noteworthy

JSON in Query Params or How to Inject Custom Java Types via JAX-RS Parameter Annotations

Although I am not a big fan of sending JSON in other places than in the message body as the entity, for example in query parameter in case of requests, it’s not a rare use-case and the way how it can be solved in JAX-RS 2.0 gives me a nice opportunity to illustrate usage of two new interfaces, ParamConverterProvider and ParamConverter. You can then re-use this approach to inject other media-types or formats your application relies on via @*Param annotations (@MatrixParam, @QueryParam, @PathParam, @CookieParam, @HeaderParam).

Continue reading JSON in Query Params or How to Inject Custom Java Types via JAX-RS Parameter Annotations

Filtering JAX-RS Entities with Standard Security Annotations

Few times I’ve ran into a situation in which I wanted to return only a part of entity I was working with, in my service, to the client-side. Feature that would allow me to send this partial set of fields should not only be driven by my own filtering rules but it also should take into consideration application roles the current user is in. It’s not an uncommon use-case I’d say so in Jersey we’d come up with the Entity Filtering concept that would allow you to do such a thing: sending subgraph of entities from server to client (and vice versa), define your own filtering rules and make sure users get only the fields they are supposed to see.

Continue reading Filtering JAX-RS Entities with Standard Security Annotations

Handling JAX-RS and Bean Validation Errors with MVC

Since JAX-RS 2.0 you can use Bean Validation to validate inputs received from users and outputs created in your application. It’s a handy feature and in most cases it works great. But what if you’re using also MVC and you want to display custom error page if something goes wrong? Or what if you want to handle Bean Validation issues in a slightly different way than JAX-RS implementation you’re using does? This article will give you some answers to these questions.

Continue reading Handling JAX-RS and Bean Validation Errors with MVC