jsessionID gets appended to the url when running GAE devserver

混江龙づ霸主 提交于 2019-12-09 03:06:37

问题


For some reason string like: ;jsessionid=SESSION_HERE gets added to urls when I visit my app deployed to GAE devserver.

This messes things up since for some of the urls it cannot be parsed as as a GET parameter at all (sometimes it ends up with urls like: http://localhost:8080/someurl;jsessionid=0000).

My webapp configuraion is trivial and I use maven and appengine-maven-plugin to run devserver like this:

mvn appengine:devserver

What is the reason of this and how this can be removed?


回答1:


Add:

<context-param>
    <param-name>org.mortbay.jetty.servlet.SessionURL</param-name>
    <param-value>none</param-value>
</context-param>

... to your web.xml. Read more on this in jetty session documentation.

Note: GAE is running on Jetty 6.1. In anyone experiences the same problem with a newer Jetty version, the configuration parameter is named differently, see Jetty 9 session management:

  • org.eclipse.jetty.servlet.SessionIdPathParameterName

  • jsessionid

  • Session URL parameter name. Defaults to jsessionid, but can be set for a particular webapp with this context param. Set to "none" to disable URL rewriting.



来源:https://stackoverflow.com/questions/19678810/jsessionid-gets-appended-to-the-url-when-running-gae-devserver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!