You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Trent <jt...@structsoft.com> on 2001/05/21 22:03:15 UTC
Getting Base deployment directory (Tomcat)
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?
Thanks,
Jeff
Re: Getting Base deployment directory (Tomcat)
Posted by "Craig R. McClanahan" <cr...@apache.org>.
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