2013/3/20 Shelley <randomshel...@gmail.com>: > I've configured an error-page in my web.xml to handle 501 error-codes, but > the resource specified in the location entry is not being returned by the > container as expected. > > Here is the content of my web deployment descriptor. Note that the 404 > error-page works as expected, but the 501 error-page does not. > > <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" > java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> > > <error-page> > <error-code>404</error-code> > <location>/404</location> > </error-page> > <error-page> > <error-code>501</error-code> > <location>/501</location> > </error-page> > > </web-app> > > Without an error-page element for the 501, the default Tomcat HTML error > page is returned with a status code of 501. When I add the error-page > element, the response status code is 501 but no content is returned > (Content-Length: 0). Instead, I would expect the content of my "/501" > location to be returned. (This is the exact problem that was described in > this thread [1] a couple years ago, but this thread did not seem to have an > answer/conclusion.) > > This is occurring on Apache Tomcat 7.0.37. > > Is there some additional configuration or modification needed for Tomcat to > honor the error-page location, or is this a bug? > > [1] > http://mail-archives.apache.org/mod_mbox/tomcat-users/201109.mbox/%3c32475425.p...@talk.nabble.com%3E
1. How to you send your error and how do you test it? 2. You may try debugging, w3ith a breakpoint in o.a.catalina.core.StandardHostValve.status(..) http://wiki.apache.org/tomcat/FAQ/Developing#Debugging 3. What is your error page? A servlet, a static file, a JSP? 4. 501 is "invalid method". I wonder whether it tries to serve the error page itself using the same "wrong" method. E.g. the DefaultServlet processes only valid methods (GET, POST, HEAD, ...). Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org