tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54536] ErrorReportValve doesn't respect HttpServletResponse.sendError(int sc, String msg)
Date Tue, 12 Feb 2013 13:42:29 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54536

--- Comment #6 from Konstantin Kolinko <knst.kolinko@gmail.com> ---
(In reply to comment #0)
>
> The correct revision is r1362000
>
> The change of the             
>    report = sm.getString("http." + statusCode, message);
> to
>    report = sm.getString("http." + statusCode);
> 
> results in 'report==null' for custom status codes

Regarding the change in r1362000

The 2nd argument to sm.getString(..) is not a default value, but an argument
used for "{0}" in a MessageFormat.

BUT, there is small difference in the values returned by
(a) sm.getString(key) and
(b) sm.getString(key, args)
when the resource is not found.

(a) returns null, (b) returns MessageFormat.format(key, args) which is "key"

This caused a change in behaviour that this code block is now called:

> 
>         if (report == null) {
>             return;
>         }

Thus instead of rendering the "default" error page, a blank page is rendered.


BTW, I suspect that you can fix your issue by defining a custom error page in
your web.xml, instead of relying on the default one.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


Mime
View raw message