2010-10-12

gzip for tomcat

If you want to add compressing to tomcat, edit TOMCAT_HOME/conf/server.xml and add the following properties to Connector element:

compression="on" compressionMinSize="2048" noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html,text/xml"


so it will lokk somethng similar as:


connectionTimeout="20000"
redirectPort="8443"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml" />

2010-10-11

starting tomcat in debug mode from maven

If you want to start tomcat from maven you just simply run:


mvn tomcat:run


if you want to run it in debug mode, in order to be able to remote debug it, set the MAVEN_OPTS to:


export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9000"


to connect to this process from eclipse/sts open the debug/debug configurations dialog, and choose: Remore Java Application (even if its running on localhost)