I do have the following configuration as a Guice module (instead of a web.xml)
public class RestModule extends JerseyServletModule {
@Override
protected void configureServlets() {
install(new JpaPersistModule("myDB"));
filter("/*").through(PersistFilter.class);
bind(CustomerList.class);
bind(OrdersList.class);
bind(MessageBodyReader.class).to(JacksonJsonProvider.class);
bind(MessageBodyWriter.class).to(JacksonJsonProvider.class);
ImmutableMap<String, String> settings = ImmutableMap.of(
JSONConfiguration.FEATURE_POJO_MAPPING, "true"
);
serve("/*").with(GuiceContainer.class, settings);
}
}
Serving the REST endpoints does work very well already.
I would like to serve a static html file from /webapp/index.html when the user requests http://example.com/
and the rest services at http://example.com/customers or http://example.com/orders
i do not use a web.xml. the webserver is jetty