Hi,
getServletContextName requires that you define it in your web.xml, and
doesn't need to correspond to the path attribute of the Context element,
so don't count on that.
Yoav Shapira
Millennium Research Informatics
-Original Message-
From: Dov Rosenberg [mailto:[EMAIL PROTECTED]
request.getContextPath();
Is there a way to do it when not serving a web page? Like in a startup
servlet that has a ServletConfig/Context, but doesn't have a request? This
way, the context could be retrieved once and cached and used in situations
unrelated to processing a specific HTTP
A ServletConfig reference is passed in the call to the init() method of your
servlet. From this you may use the getServletContext() method to get the
context. One thing to remember is that this does not get called until the
servlet is initialized and would be invalidated when it is destroyed. I
A ServletConfig reference is passed in the call to the init() method of
your
servlet. From this you may use the getServletContext() method to get the
context. One thing to remember is that this does not get called until the
servlet is initialized and would be invalidated when it is destroyed.
Have you tried ?
request.getServletPath();
Keith
-Original Message-
From: Dov Rosenberg [mailto:[EMAIL PROTECTED]
Sent: Monday, August 09, 2004 9:49 PM
To: Tomcat Users List
Subject: How to get the context path for a web application?
I need to find a way to get the context path of
also,
request.getContextPath();
aris
-Original Message-
From: Keith Bottner [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 10, 2004 12:10 PM
To: 'Tomcat Users List'
Subject: RE: How to get the context path for a web application?
Have you tried ?
request.getServletPath();
Keith