Coding Filters and Interceptors for your RESTFul services

Jakarta Restful Web Services includes an Interceptor API that allows developers to intercept request and response processing. This allows addressing some advanced concepts like authentication, caching, and compressing without polluting application code. Jakarta Restful Web Services define two broad categories to intercept requests and responses: Filters and Entity Interceptors. Filters are used to modify or … Read more

Getting started with RESTEasy and WildFly

A REST API, also known as a RESTful API, is an application programming interface that conforms to the constraints of the REST architectural style. When a client sends a request using a RESTful API, it transfers a representative state of the resource to the requester or endpoint. The information can use several formats, such as: … Read more

REST CRUD application with JPA | A complete example

This tutorial will teach you how to create an example REST (JAX-RS) CRUD application (to be run on the top of WildFly application server) which uses JPA to store your Resources. Building the CRUD JAX-RS Service Our JAX-RS Service will use the following HTTP methods to send and retrieve data from/to the server: GET: The GET … Read more

Configuring RESTEasy Applications

Since WildFly 20, you can configure RESTEasy through the MicroProfile Config project (https://github.com/eclipse/microprofile-config). The use of MicroProfile Config offers to REST developers a plenty of flexibility in controlling runtime configuration. If you want to read more details about MicroProfile Config API, we recommend checking this tutorial: Configuring Microservices with MicroProfile Configuration In a nutshell, the … Read more

JAX-RS CRUD Application using Vue.js and RESTEasy

Let’s check in this tutorial how to build a  JAX-RS CRUD application (on the top of WildFly application server) using Vue.js and Axios as Front End. Let’s start with some basic concepts about Vue.js: in a nutshell, Vue.js is a system that enables us to declaratively render data to the DOM using straightforward template syntax. … Read more

REST Services Cheat sheet

Here is a comprehensive JAX-RS Cheatsheet to help you code your REST Services. JAX RS-Annotations @Path: Path to annotate a method or a Class with the resource path it represents. For instance: @Path(“/hello”) public class CustomerEndpoint { } @Produces: To specify the output type that the resource produces, or in a narrower scope the type … Read more

WildFly Hello World example application

In this tutorial we will learn how to create a simple Hello World JAX-RS application for WildFly using just Maven and the Command Line. Pre-requisites: You need a WildFly application server. Read here how to get started with it: Getting started with WildFly Next, we will create a project using a Maven archetype to bootstrap … Read more

RESTAssured tutorial

This tutorial discusses about RESTAssured, a Testing framework that is used by several frameworks (including Quarkus) to test specifically REST applications. REST Assured is a Java API that can be used to validate RESTful services through its fluent DSL (Domain specific Languages) that describes a connection to an HTTP endpoint and expected results. Here is … Read more

Securing JAX-RS Services in WildFly applications

In this tutorial we will learn how to secure a JAX-RS Service using an Elytron File System Realm, restricting access to methods using javax.annotation.security annotations. This example will be deployed on WildFly application server so, in order to get started, download the latest WildFly release from http://www.wildfly.org In order to get started we will at … Read more

Using JAX-RS Server Sent Events with WildFly

JAX-RS 2.1 (JSR 370) contains several enhancements like Server Sent Events which will be discussed in this tutorial. Here are in a nutshell the key enhancements provided by JAX-RS 2.1 : Support for Server Sent Events (server and client) JSON Binding (JSON-B) API integration We have already discussed about JSON Binding (JSON-B) in this tutorial … Read more