Could be because ServletContext doesn't have that method. You might
want to try using getServletContextName().
The Servlet API is available online at the tomcat website.
--David
aladdin wrote:
> I have the following two lines of code in a context listener:
>
> ServletContext sc= e.getServletContext(); // e is a ServletContextEvent
> log.write("AppInitializer::ContextInitializer: context name='" + sc.getServletContextName() + "'");
> log.write("AppInitializer::ContextInitializer: context path='" + sc.getContextPath() + "'");
>
> When I try to compile this, I get:
> ./src/utils/AppInitializer.java:33: cannot find symbol
> symbol : method getContextPath()
> location: interface
javax.servlet.ServletContext> log.write("AppInitializer::ContextInitializer: context path='" + sc.getContextPath() + "'");
>
> Why is it not finding the function (and only the function) ServletContext.getContextPath()? It's the first time I've used this function, but it is typed (I think; maybe I'm going crazy- too much programming, ya' know) exactly as it appears in the Sun J2EE documentation.
>
> TIA,
> Allen
>
>
>
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)