Skip to content

Instantly share code, notes, and snippets.

@ryctabo
Created January 22, 2018 02:34
Show Gist options
  • Save ryctabo/1fed5e9b2584187a54207bf14e83cbf5 to your computer and use it in GitHub Desktop.
Save ryctabo/1fed5e9b2584187a54207bf14e83cbf5 to your computer and use it in GitHub Desktop.
Set up a web service REST with Servlet container 2.5 or higher
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="3.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<servlet>
<servlet-name>MyApplication</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>
com.github.ryctabo.jersey
</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>MyApplication</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment