views:

194

answers:

1

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?

A: 

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
please explain in detail...Is there any other way other then using request.getContextpath()...
I see that the xml tags where removed from my post...
Kees de Kooter