【发布时间】:2021-04-25 03:27:04
【问题描述】:
我有localhost:8080/app1(app1 是ear 有2 个战争项目,因此我将会话描述符添加到war 的weblogic.xml 和ear 的weblogic-application.xml 中)并希望在localhost:8080/app2 中访问它的会话。 app1 有身份验证部分,所以我想在 app2 中访问 app1 的会话。注意 app1 和 app2 都是不同的耳朵。
其中一个war文件的weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
xmlns:bae="http://www.bea.com/ns/weblogic/90"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd">
<bae:session-descriptor>
<bae:persistent-store-type>memory</bae:persistent-store-type>
<bae:sharing-enabled>true</bae:sharing-enabled>
</bae:session-descriptor>
<wls:library-ref>
<wls:library-name>jstl</wls:library-name>
<wls:specification-version>1.2</wls:specification-version>
<wls:exact-match>true</wls:exact-match>
</wls:library-ref>
</wls:weblogic-web-app>
耳朵级别的 weblogic-application.xml 是:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application
xmlns:bae="http://www.bea.com/ns/weblogic/90"
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.5/weblogic-application.xsd">
<!--weblogic-version:12.1.3-->
<wls:application-param>
<wls:param-name>webapp.encoding.default</wls:param-name>
<wls:param-value>UTF-8</wls:param-value>
</wls:application-param>
<bae:session-descriptor>
<bae:persistent-store-type>memory</bae:persistent-store-type>
<bae:sharing-enabled>true</bae:sharing-enabled>
</bae:session-descriptor>
</wls:weblogic-application>
在 app2 中,我有一个添加代码的过滤器
HttpSession session = ((HttpServletRequest) request).getSession(false);
在这个 session 对象中,我还想将一些自定义属性从 app1 传递给 app2。
我是 weblogic 配置的新手,不太了解这些,通过阅读 This tutorial 和 this one 以及显然 StackOverflow 尝试了这些。
任何指导或帮助或建议都将非常受欢迎。
【问题讨论】:
标签: java session servlet-filters weblogic12c