-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kyle,
On 6/15/12 12:30 PM, kharp...@oreillyauto.com wrote: > I attempted to do what you prescribed but I am running into a snag > and can't figure out what I've done incorrectly. > > I have a context, we'll call it /foo > > In my ROOT web application (/) I created a servlet with a mapping > of /foo/* like so: <servlet> > <servlet-name>foo-404-change</servlet-name> > > <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> I > don't think you'll want to use the DefaultServlet for this purpose. Try defining your own servlet that merely returns a 503 response. This is better done as a servlet than a JSP, anyway. > <servlet-mapping> <servlet-name>foo-404-change</servlet-name> > <url-pattern>/foo/*</url-pattern> </servlet-mapping> > > I've created a simple JSP to respond with a 503. We'll call it > change-status.jsp. If I call this page, it works fine. However, > when I stop the context /foo, and attempt to reach /foo/whatever, I > still get a 404 as if my servlet isn't even trying to handle the > request. > > I thought maybe I needed to specify an error page so that ROOT > would know what to do with a 404, so I setup the following in the > ROOT web app's web.xml: <error-page> <error-code>404</error-code> > <location>/change-status.jsp</location> Don't map 404: just map /foo/* to your foo-404-change servlet and leave it at that. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/bsAwACgkQ9CaO5/Lv0PAdOgCfdMi3jVdXL/mQ1qtBkZG9bSAt TN0Ani5zPBO2eVCjHn+SGwbOBu93OXmP =2vo8 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org