运行GAE devserver时,jsessionID会被追加到url中 [英] jsessionID gets appended to the url when running GAE devserver

查看:123
本文介绍了运行GAE devserver时,jsessionID会被追加到url中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些原因,字符串如:; jsessionid = SESSION_HERE 在我访问部署到GAE devserver的应用程序时被添加到了网址。



由于某些url不能被解析为一个GET参数,有时会以urls结尾: http:// localhost:8080 / someurl ; jsessionid = 0000 )。



我的webapp配置文件很简单,我使用maven和 appengine-maven-plugin 像这样运行devserver:

  mvn appengine:devserver 


解决方案这是什么原因以及如何将其删除?

添加:

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

...到您的 web.xml 。请阅读码头会议文件



注意:GAE正在Jetty 6.1上运行。在任何人遇到与更新的Jetty版本相同的问题时,配置参数命名有所不同,请参阅 Jetty 9会议管理



  • org.eclipse.jetty.servlet.SessionIdPathParameterName


  • jsessionid


  • 会话URL参数名称。默认为jsessionid,但可以使用此上下文参数为特定的webapp设置。设置为无禁用URL重写。

  • 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?

    解决方案

    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.

    这篇关于运行GAE devserver时,jsessionID会被追加到url中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆