开发者

HttpUtil.encodeUrl not appending jsessionid when cookies are disabled?

开发者 https://www.devze.com 2023-02-02 19:50 出处:网络
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 d

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号