Topic: 有谁用过在多个application之间传递session值? |
Print this page |
1.有谁用过在多个application之间传递session值? | Copy to clipboard |
Posted by: changdakun Posted on: 2003-03-01 10:07 小弟 我用weblogic 7.0 建了多个application 。现在想在它们之间传递session变量。请问那位老兄 有高招 指点我一下。先谢谢了!!! |
2.Re:有谁用过在多个application之间传递session值? [Re: changdakun] | Copy to clipboard |
Posted by: xs21cn Posted on: 2003-03-01 20:31 可以使用ServletContext.getContext(“/anotherContext”)方法得到另一个context的句柄。 没在weblogic 7.0下试过,不知能否成功。 另,这种方法只能将值对象传递,这个值将不在原session的管理之下了。 |
3.Re:有谁用过在多个application之间传递session值? [Re: changdakun] | Copy to clipboard |
Posted by: atsmile Posted on: 2003-03-06 18:26 偶也有这个疑问,严重关注ing |
4.Re:有谁用过在多个application之间传递session值? [Re: atsmile] | Copy to clipboard |
Posted by: changdakun Posted on: 2003-03-07 13:24 我曾经听一个朋友说起过这个问题 他的解决办法是在web.xml中设置一下。 但现在我一直不知道该怎么设置,不知道有知道的朋友吗? 可否赐教? |
5.Re:有谁用过在多个application之间传递session值? [Re: changdakun] | Copy to clipboard |
Posted by: h_barry Posted on: 2003-03-10 11:52 创建一个application 级的静态类作为存储senssion的对象就可以了 |
6.Re:有谁用过在多个application之间传递session值? [Re: h_barry] | Copy to clipboard |
Posted by: changdakun Posted on: 2003-03-10 12:25 怎样实现 可否举例说明! 先谢谢了! |
7.Re:有谁用过在多个application之间传递session值? [Re: h_barry] | Copy to clipboard |
Posted by: snowbug Posted on: 2003-03-11 00:17 h_barry wrote: This should not work from my experience. In tomcat for example, each application is loaded in a different ClassLoader. A object created in one classloader is invisible to other classloaders. Therefore, there will be one instance of the static class per application. I remember I once used a JDBC pool library and it was attached statically to the application object. The result was that each application creates its own instance of the static object. I think a common practical way of sharing data between applications is to store it in the db. You can also serialize the objects, I guess, such as JAXB. |
8.Re:有谁用过在多个application之间传递session值? [Re: changdakun] | Copy to clipboard |
Posted by: ftang Posted on: 2003-03-11 09:04 Weblogic has an option to use Database for Session failover. that means, HTTPSession contents will be stored in DB. check your Weblogic Session Management documentation and your Database setup. Use your DB client to find if WebLogic has created some database table. You will need to write JDBC code to dirrectly fetech data from that table in your Web applications. this is also useful in testing HttpSession failover. My opinion: Sharing Session is NOT a good design. Why do you have to share HttpSession between multiple applications? Your implementation will be subject to Application Server specific implementation and easy to break. |
9.Re:有谁用过在多个application之间传递session值? [Re: ftang] | Copy to clipboard |
Posted by: changdakun Posted on: 2003-03-11 09:41 hi frang thank you very much.We are modifing application . I wish that we will become friend. Could you help me, please? I am not good in english. Please forgive me. |
10.Re:有谁用过在多个application之间传递session值? [Re: changdakun] | Copy to clipboard |
Posted by: h_barry Posted on: 2003-03-11 09:42 我的解决方法是创建一个静态的Collection集合,封装成对象,作为资源部署到weblogic服务其中,其它应用程序访问此集合对象作为交换信息的中间通道,例子吗,我正在写,等等啊 |
11.Re:有谁用过在多个application之间传递session值? [Re: changdakun] | Copy to clipboard |
Posted by: ftang Posted on: 2003-03-11 11:56 Hi, I haven't done that for Weblogic before. but I have done this for IBM WebSphere + DB2. WebSphere stores the HttpSession into DB2, you have to use the DB2 command client to look at the database. We used Store_procedure to check whether some HttpSession value are changed in the database, for our testing of Session. I read that Weblogic has an option to use database as a HttpSession backup. So I think you could try it. Also, search on the BEA Weblogic forum, see if somebody has done that before. but h_barry may have a good solution specifc to Weblogic. I am not an expert for Weblogic. One suggestion: If your session has to be shared as a business logic, USE STATEFUL SESSION BEAN. This is the model to share business logic. |
12.Re:有谁用过在多个application之间传递session值? [Re: ftang] | Copy to clipboard |
Posted by: changdakun Posted on: 2003-03-14 11:03 your email? tell me |
13.Re:有谁用过在多个application之间传递session值? [Re: changdakun] | Copy to clipboard |
Posted by: changdakun Posted on: 2003-03-14 11:05 ftang : 你处理过在jsp页上显示中文名称的图片。 |
14.Re:有谁用过在多个application之间传递session值? [Re: changdakun] | Copy to clipboard |
Posted by: yahoo163 Posted on: 2003-03-15 15:51 仔细看一下WEBLOGIC的在线文档里面有讲的 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |