On Mon, 21 May 2001, Jeff Trent wrote:

> Quick Tomcat question:  How can I retrieve the base deploy directory
> name so that I can use absolute URL paths to my action forms within an
> HREF?
> 

What you're really after is request.getContextPath().  This is the prefix
to all of the request URIs that belong to your web app.  Struts takes care
of figuring that out for you in many of it's custom tags -- for example:

  <html:link page="/menu.jsp">Click me</html:link>

in an application installed on context path "/foo" will generate

  <a href="/foo/menu.jsp">Click me</a>

> Thanks,
> Jeff
> 
> 

Craig


Reply via email to