I configured a REST application using Jersey in eclipse.
I am unable to send REST requests when the path in web.xml is configured as /*
, but when I change it to /rest/*
, I get a 404 NOT FOUND error.
There are no exceptions at the server.
The web.xml file is as shown :
<servlet>
<servlet-name>Jersey Web Application</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.app.user</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
Here is how I declared the Path in the java file
@Path("/rest/products")
public class Product {
I am getting a 404 error when I access the path /rest/products on the server URL.
What am I missing?
Help is greatly appreciated!