I'm developing a liferay 开发者_StackOverflow社区theme on which I have to place some links to other pages. Now I wanted to put those links like ${httpUtil.encodeUrl("\myPage"")}.
However when I disable cookies and visit the page I still see the page without the jsessionid appended to the myPage url. Does anyone know why this happens and a possible sollution?
I also tried some velocity functions without any success.
If you use jsp to render your page, than you have to use <c:url>
to print the url.
Added:
If you can not use <c:url>
and you need to do it by hand, then have a look at the Implmentation of <c:url>
.
Added:
In JSPs you have to "wapp" <c:url>
by <c:out>
to get the enhanced (by session id) url correct formated.
<c:url var='urlWithSession' value='\myPage' />
<a href="<c:out value='${urlWithSession}'/>">my page</a>
精彩评论