访问另一个Web应用程序的会话 [英] Access session of another web application

查看:90
本文介绍了访问另一个Web应用程序的会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在J2EE应用程序(EAR)中配置两个单独的Web应用程序(WAR)来访问共享会话上下文?

Is it possible to configure two separate web apps (WAR) in a J2EE application (EAR) to access a shared session context?

更多信息:

我最终从EAR创建了一个共享类,它将所需信息存储在静态成员中。这样就可以了,即使它看起来像是一个肮脏的黑客。

I ended up creating a shared class from the EAR which stored the required information in static members. This did the trick, even if it seemed like a dirty hack.

推荐答案

不直接。大多数容器将每个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应用程序的会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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