You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Affan Qureshi <qu...@etilize.com> on 2003/01/18 12:35:19 UTC
Filter shows blank page in 4.1.18
I had filters configured for my webapp which worked in Tomcat 4.1.12 but now
when I have installed 4.1.18 I get a blank page for *some* of my pages which
do *not* contain images. The ones that contain images look fine and the
filter works on them too. Strange problem. What must I be doing wrong?
Also can I map filters based on content-type instead of urls?
Here is my filter config:
<filter>
<filter-name>trimfilter</filter-name>
<filter-class>com.etilize.cms.web.filter.TrimFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>trimfilter</filter-name> <url-pattern>*.do</url-pattern>
</filter-mapping>
<!--
<filter>
<filter-name>gzipfilter</filter-name>
<filter-class>com.etilize.cms.web.filter.GZIPFilter</filter-class>
<init-param>
<param-name>compressionThreshold</param-name>
<param-value>10</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>gzipfilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
-->
Thanks a lot,
Affan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Filter shows blank page in 4.1.18
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Sat, 18 Jan 2003, Affan Qureshi wrote:
> Date: Sat, 18 Jan 2003 16:35:19 +0500
> From: Affan Qureshi <qu...@etilize.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user <to...@jakarta.apache.org>
> Subject: Filter shows blank page in 4.1.18
>
> I had filters configured for my webapp which worked in Tomcat 4.1.12 but now
> when I have installed 4.1.18 I get a blank page for *some* of my pages which
> do *not* contain images. The ones that contain images look fine and the
> filter works on them too. Strange problem. What must I be doing wrong?
>
Most likely your filter is throwing an exception. Check the log files in
$CATALINA_HOME/logs for details.
> Also can I map filters based on content-type instead of urls?
>
In the deployment descriptor, you can filter on either servlet name or URL
pattern. However, it's pretty easy to set up your own filtering on
content type along the following lines:
* Map your filter to "/*".
* Create a response wrapper that lets you get the content type
from the response (see my post yesterday with example code),
and/or add this ability to your own response wrapper.
* In your doFilter() method, retrieve the content type and do the
right thing for the right content types.
Craig
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>