On 03/12/2019 17:15, Peter Kreuser wrote:
> Am 03.12.2019 um 14:31 schrieb Mark Thomas <ma...@apache.org>:

<snip>
>> 1. Deploy a ROOT web application with appropriate error page
>> configuration. This will catch all URLs that aren't mapped to any other
>> deployed applications.
> 
> Wouldn’t the global web.xml provide sort of the same solution - if it‘s 
> really Sumit‘s intention to provide a custom 404 page only, for all apps?

No. There are two issues with that approach:
- It would require a ROOT web application to be deployed (there probably
is one but it wasn't clear if there was).
- Every web application would need to have the error pages in exactly
the same location relative to the web application root. There are ways
to do this without actually changing every deployed web app but it all
adds (unnecessary) complexity.

> The Root-context approach may not work, if you hit a bad request/400, right?

It depends how early in the request processing you hit that error. The
ErrorReportValve may not work in some cases etiher.

>> 2. Use errorCode.0="..." and/or exceptionType.java.lang.Throwable="..."
>> attributes of the ErrorReportValve to define static web pages for those
>> errors.
>>
>> http://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Error_Report_Valve/Attributes
> 
> That‘s neat! It‘s not available in 8.5 though, that‘s why I used a 
> CustomErrorReportValve until now.
> good to now, that will indeed remove complexity, as I‘d always have to deploy 
> a global lib.

It might be possible to back-port that feature to 8.5.x. From memory, I
don't think that changes were too invasive.

Mark

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

Reply via email to