// No cache header in all responses... otherwise some browsers
// can decide to cache some requests and they shouldn't
context.addFilter(NoCacheFilter.class, "/*", Handler.DEFAULT);
// Adding support to GZip compression responses.
FilterHolder gzipFilter = context.addFilter(GzipFilter.class, "/*", Handler.REQUEST);
gzipFilter.setInitParameter("mimeTypes", "text/html,text/plain,text/xml,application/xhtml+xml,text/css,application/javascript,image/svg+xml,application/json");
gzipFilter.setInitParameter("bufferSize", "16384");
gzipFilter.setInitParameter("methods", "GET,POST");
ResourceCollection resources = new ResourceCollection(new String[] { Resource
.newClassPathResource("panel").toString() });
context.setBaseResource(resources);