You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ludwig Magnusson <lu...@itcatapult.com> on 2012/04/22 20:26:33 UTC

Tomcat 6.0.35 filters not invoked for error-pages

Hello.
I found some strange behavour in tomcat 6.0.35 when declaring error-pages in my web.xml. When tomcat picks up an error and redirects it to the location given by the <location> element in <error-page>, the filters that would have been invoked for that location are actually not invoked.

I found an almost identical report in the bug database: https://issues.apache.org/bugzilla/show_bug.cgi?id=49098 (the user had the same problem when using query strings in <location>).
However, I do not use query strings in my locations and I still get the error.

Is this a bug and is it known?
/Ludwig

Re: Tomcat 6.0.35 filters not invoked for error-pages

Posted by Ludwig Magnusson <lu...@mediatool.com>.
That was it. Thanks =)

---------- 
From: Konstantin Kolinko 
Sent: Tuesday, April 24, 2012 7:08 PM 
To: Tomcat Users List 
Subject: Re: Tomcat 6.0.35 filters not invoked for error-pages 

2012/4/24 Ludwig Magnusson <lu...@mediatool.com>:
> Thanks for your reply.
>
> First of all: I have solved the acutal problem caused by this in a more
> stable way.
>
> But out of curiosity I tried your solution and it does not work either.
> this is my setup:
>
> <servlet>
>   <servlet-name>myservlet</servlet-name>
>   <servlet-class>mypackage.MyServlet</servlet-class>
> </servlet>
>
> <servlet-mapping>
>   <servlet-name>myservlet</servlet-name>
>   <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> <filter-mapping>
>   <filter-name>myfilter</filter-name>
>   <servlet-name>myservlet</servlet-name>
>   <dispatcher>REQUEST</dispatcher>
>   <dispatcher>FORWARD</dispatcher>

<dispatcher>ERROR</dispatcher>
Since Servlet 2.4.

> </filter-mapping>
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6.0.35 filters not invoked for error-pages

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/4/24 Ludwig Magnusson <lu...@mediatool.com>:
> Thanks for your reply.
>
> First of all: I have solved the acutal problem caused by this in a more
> stable way.
>
> But out of curiosity I tried your solution and it does not work either.
> this is my setup:
>
> <servlet>
>   <servlet-name>myservlet</servlet-name>
>   <servlet-class>mypackage.MyServlet</servlet-class>
> </servlet>
>
> <servlet-mapping>
>   <servlet-name>myservlet</servlet-name>
>   <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> <filter-mapping>
>   <filter-name>myfilter</filter-name>
>   <servlet-name>myservlet</servlet-name>
>   <dispatcher>REQUEST</dispatcher>
>   <dispatcher>FORWARD</dispatcher>

<dispatcher>ERROR</dispatcher>
Since Servlet 2.4.

> </filter-mapping>
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6.0.35 filters not invoked for error-pages

Posted by Ludwig Magnusson <lu...@mediatool.com>.
Thanks for your reply.

First of all: I have solved the acutal problem caused by this in a more 
stable way.

But out of curiosity I tried your solution and it does not work either.
this is my setup:

<servlet>
    <servlet-name>myservlet</servlet-name>
    <servlet-class>mypackage.MyServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>myservlet</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

<filter-mapping>
    <filter-name>myfilter</filter-name>
    <servlet-name>myservlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

/Ludwig

-----Ursprungligt meddelande----- 
From: Christopher Schultz
Sent: Monday, April 23, 2012 4:05 PM
To: Tomcat Users List
Subject: Re: Tomcat 6.0.35 filters not invoked for error-pages

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ludwig,

On 4/22/12 2:26 PM, Ludwig Magnusson wrote:
> Hello. I found some strange behavour in tomcat 6.0.35 when
> declaring error-pages in my web.xml. When tomcat picks up an error
> and redirects it to the location given by the <location> element in
> <error-page>, the filters that would have been invoked for that
> location are actually not invoked.
>
> I found an almost identical report in the bug database:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=49098 (the user
> had the same problem when using query strings in <location>).
> However, I do not use query strings in my locations and I still get
> the error.
>
> Is this a bug and is it known?

What does your web.xml look like?

The error page is probably treated as a FORWARD, and you'll have to
configure your filters to fire on FORWARD as well as REQUEST (the
default).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+VYaMACgkQ9CaO5/Lv0PD4cwCff6+JoDHqehqsEtTMU471Np1+
MicAoKYezgJgAQ+0EWP71UkDFRb41nBf
=/UDF
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6.0.35 filters not invoked for error-pages

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ludwig,

On 4/22/12 2:26 PM, Ludwig Magnusson wrote:
> Hello. I found some strange behavour in tomcat 6.0.35 when
> declaring error-pages in my web.xml. When tomcat picks up an error
> and redirects it to the location given by the <location> element in
> <error-page>, the filters that would have been invoked for that
> location are actually not invoked.
> 
> I found an almost identical report in the bug database:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=49098 (the user
> had the same problem when using query strings in <location>). 
> However, I do not use query strings in my locations and I still get
> the error.
> 
> Is this a bug and is it known?

What does your web.xml look like?

The error page is probably treated as a FORWARD, and you'll have to
configure your filters to fire on FORWARD as well as REQUEST (the
default).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+VYaMACgkQ9CaO5/Lv0PD4cwCff6+JoDHqehqsEtTMU471Np1+
MicAoKYezgJgAQ+0EWP71UkDFRb41nBf
=/UDF
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org