gpt4 book ai didi

java - 从 Myeclipse IDE 重新部署之间保持 Tomcat 服务器应用程序 session

转载 作者:搜寻专家 更新时间:2023-11-01 03:29:06 24 4
gpt4 key购买 nike

全部我正在使用 Tomcat 6.X 和 My Eclipse 开发 Web 应用程序。当我对现有的 java 文件(Java 类、SERVLETS、过滤器)进行一些更改时,我必须将它重新部署到 tomcat 服务器。但是,当我重新部署应用程序时

existing session becomes null .

有什么方法可以让我在 MY ECLISPE 的重新部署之间保留现有 session 。

最佳答案

来自 Tomcat Docs

在此处查看有关 JDBC persistence 的教程, tomcat-6-session-persistence-through-jdbcstore

  • 基于文件
  • 基于 JDBC 的商店

Restart Persistence

Whenver Catalina is shut down normally and restarted, or when an application reload is triggered, the standard Manager implementation will attempt to serialize all currently active sessions to a disk file located via the pathname attribute. All such saved sessions will then be deserialized and activated (assuming they have not expired in the mean time) when the application reload is completed.

In order to successfully restore the state of session attributes, all such attributes MUST implement the java.io.Serializable interface. You MAY cause the Manager to enforce this restriction by including the element in your web application deployment descriptor (/WEB-INF/web.xml).

关于java - 从 Myeclipse IDE 重新部署之间保持 Tomcat 服务器应用程序 session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5387267/

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