The JAX-RS 1.1 specification says on page 6:
If no Application subclass is present the added servlet MUST be named:
javax.ws.rs.core
With WAS 8.5, I change the web.xml to add:
com.ibm.websphere.jaxrs.server.IBMRestServlet
javax.ws.rs.Application
com.tada.rest.RestApplication
1
javax.ws.rs.core.Application
javax.ws.rs.core.Application
/rest/*
My RestApplication look like :
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.core.Application;
public class RestApplication extends Application {
@Override
public Set> getClasses() {
Set> sets = new HashSet>();
sets.add(RestService.class);
return sets;
}
}
My RestService looks like
@Path("/tada")
public class RestService {
@GET
public String getSomething() {
return "tada";
}
}
And I add in the pom.xml the dependency:
javax.ws.rs
javax.ws.rs-api
2.0