File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Session Info/Timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Info/Timeout" Watch "Session Info/Timeout" New topic
Author

Session Info/Timeout

Sammy Ghosh
Greenhorn

Joined: May 15, 2003
Posts: 3
If from a website we access say 3 different application(3 ear files) & we need to a pass around some common session data (1)how do we do it (2)if for each application there's a different session timeout limit which timeout will take precedence.
we will be using WAS 5
Thanks to all forum members.
Paul Lester
Ranch Hand

Joined: Dec 27, 2002
Posts: 40
I am assuming that you are talking about 3 different web applications that use EJB, since you are using an EAR file.
First, with regards to the session timeout, none of them take precedence. They are all independent. The first one to time out will be the one with the shortest duration.
Secondly, you could share data between the applications using the JNDI tree, but they will each have their own session objects. Also, as they are different applications, they don't share the same session. The easiest way to communicate with them is through use of the query string, unless you have to pass objects, then you'd have to use the JNDI tree.
The EJBs should be able reachable via the InitialContext and the lookup method.
I hope that this helps.
Paul


Where Photography meets vision.<br /><a href="http://www.photogravision.com" target="_blank" rel="nofollow">http://www.photogravision.com</a><br />Please stop by!<br /> <br />SCJP,SCWCD,SCJD,SCEA
Sammy Ghosh
Greenhorn

Joined: May 15, 2003
Posts: 3
Thanks Paul for your input.
FYI, none of the 3 applications use EJB's.
Each application is a web app, deployed as 3 independent applications(3 ears) under SAME VIRTUAL HOST.
Since they are different ear files any objects stored within HttpSession object is not accessible by the other application.(Shouldn't be a problem if the app. was deployed as single ear with 3 wars).
How do you use a JNDI tree to pass some object between different application.
JNDI's are used for lookups of resources only(Correct me if I am wrong)
Thanks again Paul.
Paul Lester
Ranch Hand

Joined: Dec 27, 2002
Posts: 40

This will put the object into the tree. Now, from anywhere else within that context, you can look up that object:


You probably want to keep a context hanging around because they are expensive (time consuming) to create.
This is the preferred way to share objects in a cluster as there may be multiple JVMs involved.
Paul
[ May 20, 2003: Message edited by: Paul Lester ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Info/Timeout