JSR 311 (http://jcp.org/en/jsr/detail?id=311) specifies the Java API for RESTful Web services (JAX-RS) for developing REST (Representational State Transfer) Web services with Java. REST is a protocol independent, loosely coupled, software architecture style for distributed systems. A RESTful Web service exposes a set of resources, which are simply sources of information, identified by URIs (Uniform Resource Identifiers) in HTTP. RESTful Web services follow these RESTful principles:
GET
, PUT
, POST
, and DELETE
are usedJSR 339 (https://www.jcp.org/en/jsr/detail?id=339) develops the JAX-RS 2.0 version. JAX-RS 2.0 provides several new features, such as a Client API, support for validation, filters and interceptors, and asynchronous processing. We will discuss the salient new features in JAX RS 2.0 using the RESTEasy (http://resteasy.jboss.org/) implementation. This chapter has the following sections:
We need to install the following software:
wildfly-8.1.0.Final.zip
from http://wildfly.org/downloads/.Set the environment variables JAVA_HOME
, JBOSS_HOME
, and MAVEN_HOME
. Add %JAVA_HOME%/bin
, %MAVEN_HOME%/bin
, and %JBOSS_HOME%/bin
to the PATH
environment variable.
Create a WildFly 8.1.0 runtime as discussed in Chapter 1, Getting Started with EJB 3.x. Create a MySQL data source with the JNDI name java:jboss/datasources/MySQLDS
as explained in Chapter 1, Getting Started with EJB 3.x.