gpt4 book ai didi

session - 如何在 geronimo/tomcat 中关闭 session 持久性

转载 作者:行者123 更新时间:2023-11-28 21:48:50 25 4
gpt4 key购买 nike

如何关闭 geronimo 的 session 持久性?这是我应该做的事吗? - 我在我的应用程序中没有使用持久 session 。 (这是因为我在控制台收到不可序列化错误,但我不想序列化)

最佳答案

这取决于您在 Geronimo 中使用的 Web 容器;支持 Tomcat 和 Jetty。

Tomcat
将 context.xml 文件添加到您的应用程序或添加这些节点:

<Context><Manager className="org.apache.catalina.session.StandardManager"
pathname=""></Manager></Context>

来自路径名的 tomcat 文档:可以通过将此属性设置为空字符串来禁用重新启动持久性。

这些属性在这些链接中进行了解释:
https://cwiki.apache.org/GMOxDOC22/configuring-session-manager-of-tomcat.html
http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html#Standard_Implementation

码头
默认情况下,此容器不会保留 session ,因此除了确保 SessionHandler 未启用外,别无他法。如果您的上下文配置中存在 sessionHandler 节点,请将其移除。

<Set name="sessionHandler">
<New class="org.eclipse.jetty.servlet.SessionHandler">
<Arg>
<New class="org.eclipse.jetty.servlet.HashSessionManager">
<Set name="storeDirectory">your/chosen/directory/goes/here</Set>
</New>
</Arg>
</New></Set>

信息链接:
http://wiki.eclipse.org/Jetty/Howto/Persisting_Sessions

关于session - 如何在 geronimo/tomcat 中关闭 session 持久性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8181664/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com