On 22/02/2011 21:36, alex wrote: > Mark Thomas wrote: >> On 22/02/2011 17:26, Caldarale, Charles R wrote: >>>> From: alex [mailto:alex.alex.alex.9...@gmail.com] Subject: Re: >>>> related to bad url encoding?... >>>> shouldn't it be 404 error if tomcat can't map "this call"? >>> Tomcat 7 has introduced revised handling for situations where there >>> is no ROOT webapp; you might want to try that. Regardless, you still >>> can only use a custom error page on a mapping failure if you've got a >>> default webapp (ROOT) and configure ROOT's WEB-INF/web.xml for it. >> >> It isn't going to help in this case. The URL is not valid so it is >> correctly rejected by the connector with a 400 response. Since the URL >> is invalid, it can't reliably be used to map it to a web application so >> there is no opportunity to use an application generated/supplied error >> page. > > so, what do I do if I need to show error in this scenario and I run > standalone tomcat? > can I do it in custom filter/connector or the only solution to place > tomcat behind apache?
A filter is too late in the chain, as is a valve. A custom connector code seems like overkill for this. I would probably go with httpd myself. There may be a way to get the request to be forwarded to the default host where the default error handler could respond but I suspect that approach could quickly get messy. One of the reasons for rejected the requests in the connector was performance. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org