0

I am currently working on a huge web application consisting of JSPs. Also I use WebWork framework.

Until now the context root of my application was "/". Now I want to change that to "nstat".

How should I handle the relative and absolute calls from my JSPs?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

For jsps you can use the <c:url/> tag to build proper relative urls. Webwork has a similir custom tag named <ww:url/>.

<c:url val="somepath/some.jsp"/>

Will be translated to "/nstat/somepath/some.jsp". If you set the var attribute you can use the url later on in your jsp using the ${} notation.

Kees de Kooter
  • 7,078
  • 5
  • 38
  • 45
  • please explain in detail... Is there any other way other then using request.getContextpath()... –  Mar 13 '09 at 04:41