I have a basic REST web service that works but I do have a question. Here is a brief code snip.
package com.my.app;
import org.glassfish.jersey.server.ResourceConfig;
import javax.ws.rs.ApplicationPath;
@ApplicationPath("api")
public class RestApplication extends ResourceConfig {
RestApplication() {
packages("com.my.app");
}
}
And
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>The name of my service!</display-name>
</web-app>
I have been digging around in the Jersey documentation at https://jersey.java.net/apidocs/2.25.1/jersey/org/glassfish/jersey/server/ResourceConfig.html and I haven't found a way to set the Tomcat display name or version. Now I can just set those parameters in the web.xml and that works just fine but I would rather set the parameters in my class that extends ResourceConfig and get rid of the web.xml altogether. Is this possible or should I just stick with using the web.xml? Any suggestions would be greatly appreciated.