tomcat etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
tomcat etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

3 Mart 2011 Perşembe

How to enable gzip compression for Tomcat?.

You should edit server.xml which is located under conf directory of tomcat installation.
You should add these attributes to connector element.


compression="on" compressableMimeTypes="text/html,text/xml,text/javascript,text/css"



After the modification connector element would be like this ;

<8080" protocol="HTTP/1.1" 
connectionTimeout="20000" redirectPort="8443"
compression="on" compressableMimeTypes="text/html,text/xml,
text/javascript,text/css"/>

15 Ekim 2010 Cuma

Maven class loading issues

Recently, I have tried to port one of our project to maven. When I try to use tomcat maven plugin,  I have got the below exception;

java.lang.ClassCastException: tr.com.belsis.common.web.utils.InitServlet cannot be cast to javax.servlet.Servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)

Multiple javax.servlet.Servlet at class path causes this exception. The solution is to define the scope of servlet dependency as provided as below;

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>