Reference Guide

Table Of Contents
<groupId>com.sun.jersey.jersey-test-framework</groupId>
<artifactId>jersey-test-framework-grizzly</artifactId>
<version>1.17</version>
<scope>test</scope>
</dependency><dependency>
<roupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>1.17</version>
</dependency>
The hm-rs module needs to be modified so it produces a web application archive (.war file) [35]
as output so it is deployed as a web application that serves the RESTful web services for this
sample application. Create the file hm-rs/src/main/webapp/WEB-INF/web.xml with the content
shown in REST Module Web Application (web.xml) listing. The REST Module Web Application
(web.xml) listing configures the Jersey Servlet [2] that handles HTTP requests and dispatches to the
right REST API based on the @Path annotations. The highlighted text in the next listing emphasizes
the way the application’s RESTful web services are registered within the Jersey Servlet.
REST Module Web Application (web.xml):
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Health Monitor REST API</display-name>
<servlet>
<servlet-name>REST Services</servlet-name>
<servlet-
class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-
name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.hp.sdn.rs.misc.CrossDomainFilter</param-value>
</init-param>
<init-param>
<param-name>com.hp.sdn.rs.AllowsDomains</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-
name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.hp.util.rs.auth.AuthJerseyFilter</param-value>
</init-param>
<init-param>
172