Thanks Matt. This is in fact what I have been doing to date :) . The problem is, that to configure the error page to handle several different status codes, you have to keep repeating basically the same 4 lines of config, with just the error code changing each time - a bit repetitive, and not good from a maintenance viewpoint. I'm thinking that there must be a neater way.....?
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Friday 15 October 2004 06:16 > To: Tomcat Users List > Subject: Re: bad <error-code> syntax - ignore or throw exception? > > > Try... > > <error-page> > <error-code>404</error-code> > <location>>/WEB-INF/jsp/Error.jsp</location> > </error-page> > <error-page> > <error-code>406</error-code> > <location>>/WEB-INF/jsp/Error.jsp</location> > </error-page> > > I am not sure if you can combine them in one <error-page> tag > however some > of our more experienced people on this list might be able to > field this > one. This is what I do in my web.xml file and it works as I > want it to (I > check for 404 and 500). > > Kindest Regards, > Matt Anderson > > > > > I'm trying to work out how to configure web.xml to use a > custom error page > > when one of a list of HTTP status codes are encountered. > Couldn't find > > any > > documentation, so pure guesswork led me to try this: > > > > <error-page> > > <error-code>404,406</error-code> > > <location>/WEB-INF/jsp/Error.jsp</location> > > </error-page> > > > > It doesn't do what I was intending, in that neither 404 nor > 406 codes are > > handled by Error.jsp - however I was surprised that there > is no Exception > > logged by Tomcat when parsing this web.xml - shouldn't it throw an > > Exception, rather than ignore it?? I've found that Tomcat > is usually very > > thorough at reporting problems with web.xml, so this seems unusual. > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]