Women in Technology

Hear us Roar



Article:
  Two Servlet Filters Every Web Application Should Have
Subject:   GZIP memory leak and content length problems
Date:   2007-01-18 05:49:27
From:   ShriniMailNSrinivasan@gmail.com
Response to: GZIP memory leak and content length problems

solution :
1. Dont try to compress html files from weblogic 8 (not tried with any other weblogic version).
2. Dont give multiple route of mapping to a filter in web.xml in weblogic 8.


To be more clear on second point ,


<filter-mapping>
<filter-name>CompressionFilter</filter-name>
<url-pattern>/servlet</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>CompressionFilter</filter-name>
<servlet-name>Index</servlet-name>
</filter-mapping>


<servlet-mapping>
<servlet-name>Index</servlet-name>
<url-pattern>/servlet</url-pattern>
</servlet-mapping>

All the request has a url patern "/servlet" passes through CompressionFilter.
All the request will reach the Index Servlet will also passes through CompressionFilter.
If a request matches both the above condition then response will be compressed twice.
Thus creates the prob of FileDownload dialog or junk chars shown.
This will not happen in tomcat.