Vijayanand Sukumar wrote:

> Hi ,
> I need to know if there is a way to get the context path from without
> creating  a dependency on tomcat. If my web-app context is /foo and I want
> to convert a  URL relative to the current context back into an external URL
> with the full  syntax.

When processing a servlet request, simply call

    String contextPath = request.getContextPath();

and you can use this value to construct an absolute URL.

>
> Thanks
> Vijayanand Sukumar

Craig McClanahan


Reply via email to