I'd like to add a Access-Control-Allow-Origin
header to all Jersey requests in my application. Is it possible to do this via the Jersey servlet so it's application wide?
ServletRegistration jerseyServletRegistration =
ctx.addServlet("JerseyServlet", new ServletContainer());
jerseyServletRegistration.setInitParameter(
"com.sun.jersey.config.property.packages", "com.production.resource");
jerseyServletRegistration.setInitParameter(
"com.sun.jersey.api.json.POJOMappingFeature", "true");
jerseyServletRegistration.setLoadOnStartup(1);
jerseyServletRegistration.addMapping("/api/*");