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 can we maintain more than one session? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "can we maintain more than one session?" Watch "can we maintain more than one session?" New topic
Author

can we maintain more than one session?

Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
Hi All
Can we create more than one session in a servlet
as My application requires that based on the field i select i shud put some value in session object
if we can have more than one session object then i can
put value for each condition in seperate session
so that retrieving is easier later on
any suggestions pls


SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

Im not certain, but I think there can be only one session. The session is usually created by calling getSession() method of HttpServletRequest class. There is an API for servlets somewhere at the sun site but im not sure of the exact url. http://java.sun.com/


SCJP
Visit my download page
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
Just use the one session but apply some imagination to the way you manipulate the objects stored in the session. A session is basically a Hashtable after all - you can create the name of the attribute to reflect the circumstances under which you want to retrieve it.
Everybody working with servlets or JSP should have a copy of the API documents, you can download them from java.sun.com.
Bill

------------------
author of:
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
It's under the heading Java 2 SDK, Enterprise Edition in http://javasoft.com/j2ee/docs.html as "API Documentation".
[This message has been edited by Tony Alicea (edited February 15, 2001).]


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
 
jQuery in Action, 2nd edition
 
subject: can we maintain more than one session?
 
Similar Threads
Siteminder Session
Session values still exist after using response.sendRedirect()
Stateless Session Bean Problems Singleton
How much weight can session handle?
People clicking Submit twice confuses database