如何在Java中跨多个Web应用程序维护相同的会话ID [英] How to maintain the same session id across multiple web applications in Java

查看:79
本文介绍了如何在Java中跨多个Web应用程序维护相同的会话ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Jboss服务器中为多个Web应用程序维护相同的会话ID?

How do I maintain the same session ID for multiple web applications in a Jboss server?

推荐答案

看看这个发布,类似的问题。 其他网络应用程序的访问会话

Take a look at this post, for similar question. Access session of another web application

这是说什么

不是直接的。大多数容器将每个WAR放在一个单独的类加载器中,EAR类加载器作为它们的父级。每个应用程序的会话都是您可以在每个会话中放置父EAR提供的内容。如果您需要它们共享某些内容,请将其设置为EAR功能。

"Not directly. Most containers put each WAR in a separate classloader with the EAR classloader as their parent. Each app's sessions are separate. You can put something provided by the parent EAR in each session. If you need them to share something, make it a EAR function."

所以,由于每个会话都是私有的,一个web-app看不到另一个。因此,您可以选择将两个Web应用程序捆绑在一个WAR文件中,以使它们能够共享会话数据。

So, due to the each session being private, one web-app cannot see the other. So, your option is to bundle the two web apps in a single WAR file, to make them be able to share session data.

这篇关于如何在Java中跨多个Web应用程序维护相同的会话ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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