I have a resource that looks like this:
@Path("/Resources/Console")
public class ConsoleResource {
@POST
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public String post(/* */) {
/* */
}
}
Whenever my JerseyServletModule is configured as follows, the services work:
@Override
protected void configureServlets() {
bind(ConsoleResource.class);
bind(MessageBodyReader.class).to(JacksonJsonProvider.class);
bind(MessageBodyWriter.class).to(JacksonJsonProvider.class);
serve("/*").with(GuiceContainer.class);
}
But things like index.html don't. Changing "/*"
to "/Resources/*"
causes things like index.html to work, again, but then ConsoleResource
's @POST
method doesn't work (I get a 404 whenever I access /Resources/Console
). I assume I want to get the latter working (like this). Thoughts?
Thanks!