So I'm trying to set up Jetty for a school project, using Jersey on the server side and Gradle to build and run it. I have my web.xml and a test that I'm trying to hit with curl. Here's what I got:
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://ift.tt/ra1lAU" xmlns="http://ift.tt/nSRXKP" xsi:schemaLocation="http://ift.tt/nSRXKP http://ift.tt/1eWqHMP" id="WebApp_ID" version="3.0">
<servlet>
<servlet-name>Project</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer
</servlet-class>
<welcome-file-list>
<welcome-file>../index.html</welcome-file>
</welcome-file-list>
<init-param>
<param-name>Project</param-name>
<param-value>main.java.package</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Reservations</servlet-name>
<url-pattern>api/*</url-pattern>
</servlet-mapping>
Web.java
package main.java.package;
import javax.ws.rs.Path;
@Path("api/")
public class Web {
@Path("test/")
public String test() {
return "it works!";
}
}
When I curl http://localhost:8080/project/api/test I just get a 503. So I'm assuming it's something with my web.xml but I just can't figure out what.
No comments:
Post a Comment