I am using Tomcat7 (embedded)
Something like this...
String APP_DIR = "ROOT";
Tomcat current = new Tomcat();
File file = new File(APP_DIR);
if (file.isDirectory() && file.canRead()) {
ctx = current.addWebapp(null, "", file.getAbsolutePath());
ctx.setSessionCookiePathUsesTrailingSlash(false);
}
current.start();
ctx.addServletMapping("*.pdf", "jsp", true);
I have enabled the *.pdf mapping to jsp servlet (some issue I had with IE) is there a way to enable GZIP with this config (I have no web.xml, but if needed I could add to make it work) So far I have only found that I need to add this to my web.xml (which I don't have!)
<Connector port=”8080″ maxHttpHeaderSize=”8192″
maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″
enableLookups=”false” redirectPort=”8443″ acceptCount=”100″
connectionTimeout=”20000″ disableUploadTimeout=”true”
compression=”on”
compressionMinSize=”2048″
noCompressionUserAgents=”gozilla, traviata”
compressableMimeType=”text/html,text/xml”/>