Skip to content
Snippets Groups Projects
Commit d8eee47b authored by Thiemo Belmega's avatar Thiemo Belmega
Browse files

Configure build and deploy for glassfish/jersey

parent 1dbd2ced
No related branches found
No related tags found
No related merge requests found
......@@ -24,9 +24,20 @@
<version>20151123</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.19</version>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
......@@ -41,6 +52,11 @@
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</build>
</project>
......@@ -12,7 +12,7 @@ import javax.ws.rs.core.Response;
public class ApplicationResource extends BusinessObjectResource {
@GET
@Path("{id}")
@Path("/{id}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response get(@PathParam(PARAM_ID) String id) {
return getBusinessObject(id);
......
......@@ -11,9 +11,9 @@ import java.sql.SQLException;
public class BusinessObjectResource {
protected static final String PATH_APPLICATION = "/application";
protected static final String PATH_FEATURE = "/feature";
protected static final String PATH_CATEGORY = "/category";
protected static final String PATH_APPLICATION = "application";
protected static final String PATH_FEATURE = "feature";
protected static final String PATH_CATEGORY = "category";
protected static final String PARAM_ID = "id";
protected Response getBusinessObject(String id) {
......
......@@ -12,7 +12,7 @@ import javax.ws.rs.core.Response;
public class CategoryResource extends BusinessObjectResource {
@GET
@Path("{id}")
@Path("/{id}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response get(@PathParam(PARAM_ID) String id) {
return getBusinessObject(id);
......
......@@ -12,7 +12,7 @@ import javax.ws.rs.core.Response;
public class FeatureResource extends BusinessObjectResource {
@GET
@Path("{id}")
@Path("/{id}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response get(@PathParam(PARAM_ID) String id) {
return getBusinessObject(id);
......
......@@ -3,5 +3,21 @@
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>ToolUP</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>
de.unipotsdam.cs.toolup.ws.resource
</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>ToolUP</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment