JAX-RS

JAX-RS HATEOAS Example - Primary Collection

Building HATEOAS Links with JAX-RS

Learn to build JAX-RS 2.0 HATEOAS links in REST resources using it’s javax.ws.rs.core.Link, javax.ws.rs.core.UriBuilder and javax.ws.rs.core.UriInfo classes.

Jersey REST API Security Example

In this Jersey rest security example, we will learn to secure Jersey REST APIs with basic authentication. This will make mandatory every user to provide username/password to authenticate into portal. Also, user must have certain level of role as well. I have extended this example from my other example created …

Jersey exception handling – Jersey ExceptionMapper Example

In Jersey ExceptionMapper example, we will learn to handle custom exceptions using ExceptionMapper interface while developing Jersey RESTful web services. For demo purpose, I am modifying the sourcecode written for jersey download file example. Table Of Contents 1. Jersey custom exception with ExceptionMapper 2. How to throw exception from REST …

Jersey – Ajax Multi-File Upload Example

Learn to use Ajax with JAX-RS webservices (Jersey used in example) to upload multiple files with single button click. Also look at form based file upload example and file download example as well. Table of Contents Jersey maven multipart dependency Add MultiPartFeature Write Upload REST API HTML/Ajax code Demo of …

RESTEasy Basic Authentication and Authorization Tutorial

Security is an integral part of any enterprise application. Security involves two phases i.e. authentication and authorization. Authentication verifies who you are. Authorization verifies what you are authorized to do. In this post, we will learn to build role based basic authentication/ authorization security for REST APIs. Sections in this …

Jersey Hello World Example

This Jersey tutorial will help you set up the Jersey environment in your local machine and get started with a simple Hello World REST API.

RESTEasy Cache control with ETag Example

ETags or entity tags are useful HTTP headers which can help in building a super fast application by minimizing the server load on system. ETag is set to the response to the client so a client can use various control request headers such as If-Match and If-None-Match for conditional requests. …

Intro to JAX-RS Custom Validation

In this example, I will show the usage of ValidatorAdapter in association with @ValidateRequest annotation. For sending the request from UI, I will use ajax. You can use form submission if needed in your project. In that case, you will need @FormParam annotation to capture request parameters. Below if the …

JAX-RS @Path URI Matching – Static and Regex URIs

Learn to use JAX-RS @Path annotation and write resource path in it for URI matching. Paths can be written in simple form (static or path parameter) or complex form (regex based). 1. JAX-RS @Path URI Matching Types JAX-RS @Path annotation is used to specify the URI on which the resources …

RESTEasy Tutorial for Beginners

RESTEasy example web application to to create REST APis using maven and tomcat server. This resteasy tutorial helps in create restful webservices.

Building HATEOAS Links with RESTEasy and JAX-RS

HATEOAS is a constraint on REST that says that a client of a REST application need only know a single fixed URL to access it. Any and all resources should be discoverable dynamically from that URL through hyperlinks included in the representations of returned resources.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.