It looks like the method ServletContext.getContextPath() was added in version 2.5 of the Servlet API (supported by Tomcat 6.0), but was not present in version 2.4 (supported by Tomcat 5.5). Is there any way to get this information at webapp load time, i.e. inside a ServletContextListener.contextInitialized() function (or any time before the first request) in Tomcat 5.5?
I'd really love to have the context path before the first request, but can't yet force our user base to upgrade to Tomcat 6.0. Thoughts? --Brendan