开发者

How do I keep Struts2 from appending jsessionid to the URL (on redirects)?

开发者 https://www.devze.com 2023-01-19 23:38 出处:网络
I want to keep the jsessionid parameter out of the URLs generated by Struts, but can\'t seem to find a configuration parameter or similar. To be honest, I don\'t even know exactly at which level this

I want to keep the jsessionid parameter out of the URLs generated by Struts, but can't seem to find a configuration parameter or similar. To be honest, I don't even know exactly at which level this is handled.

Specifically, Struts (or the servlet engine) puts a sessionid in the URL when it's redirecting with a 302 and the session has not been established before (i. e. the redirect is in respo开发者_运维知识库nse to a request that sent no Cookie header). The response also contains a Set-Cookie header.

Generally, I just don't want the session id in the URL, ever. No cookies, no session.


You can try to check what's your servlet container offers to solve this problem. Alternatively you can write a filter to get rid of jsessionid. Hae a look here for details: http://seamframework.org/Documentation/RemovingJSESSIONIDFromYourURLsAndFixingScache

0

精彩评论

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