You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Mark Thomas <ma...@apache.org> on 2011/09/01 18:25:35 UTC

Re: svn commit: r1157810 - in /tomcat/trunk: java/org/apache/catalina/core/StandardContextValve.java java/org/apache/catalina/core/StandardHostValve.java test/org/apache/catalina/core/TestStandardContextValve.java

On 15/08/2011 13:29, markt@apache.org wrote:
> Author: markt
> Date: Mon Aug 15 12:29:58 2011
> New Revision: 1157810
> 
> URL: http://svn.apache.org/viewvc?rev=1157810&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51653
> Move custom error handling from Host to Context.

This was a bad idea. The authenticators are processed before the
StandardContextValve so this broke custom error pages for 401s etc.

I'll take another look at this. My current thinking is that firing
request listeners should move to the Host with the error handling but I
need to see what that looks like.

Mark

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


Re: svn commit: r1157810 - in /tomcat/trunk: java/org/apache/catalina/core/StandardContextValve.java java/org/apache/catalina/core/StandardHostValve.java test/org/apache/catalina/core/TestStandardContextValve.java

Posted by Mark Thomas <ma...@apache.org>.
On 01/09/2011 19:05, Konstantin Kolinko wrote:
> 2011/9/1 Mark Thomas <ma...@apache.org>:
>> On 15/08/2011 13:29, markt@apache.org wrote:
>>> Author: markt
>>> Date: Mon Aug 15 12:29:58 2011
>>> New Revision: 1157810
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1157810&view=rev
>>> Log:
>>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51653
>>> Move custom error handling from Host to Context.
>>
>> This was a bad idea. The authenticators are processed before the
>> StandardContextValve so this broke custom error pages for 401s etc.
>>
>> I'll take another look at this. My current thinking is that firing
>> request listeners should move to the Host with the error handling but I
>> need to see what that looks like.
>>
> 
> I think you have seen this as well:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=51550#c9
> though I do not know whether custom error handling can work for the
> situation in BZ 51550. (I think it can't)

Yep. That is what got me started down this road.

Moving everything to the host does enable this to be handled. We could
add a try/catch around the call to the context and handle any exceptions
as a 500 error which would then pick up the context's custom error handling.

I have a patch to move the error handling and the request listeners to
the host that passes the unit tests. I'll be looking at 51550 tomorrow.

Cheers,

Mark

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


Re: svn commit: r1157810 - in /tomcat/trunk: java/org/apache/catalina/core/StandardContextValve.java java/org/apache/catalina/core/StandardHostValve.java test/org/apache/catalina/core/TestStandardContextValve.java

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/9/1 Mark Thomas <ma...@apache.org>:
> On 15/08/2011 13:29, markt@apache.org wrote:
>> Author: markt
>> Date: Mon Aug 15 12:29:58 2011
>> New Revision: 1157810
>>
>> URL: http://svn.apache.org/viewvc?rev=1157810&view=rev
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51653
>> Move custom error handling from Host to Context.
>
> This was a bad idea. The authenticators are processed before the
> StandardContextValve so this broke custom error pages for 401s etc.
>
> I'll take another look at this. My current thinking is that firing
> request listeners should move to the Host with the error handling but I
> need to see what that looks like.
>

I think you have seen this as well:
https://issues.apache.org/bugzilla/show_bug.cgi?id=51550#c9
though I do not know whether custom error handling can work for the
situation in BZ 51550. (I think it can't)

Best regards,
Konstantin Kolinko

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