That does not compute....  Your servlet HttpSession is associated with a set
of requests that a specific user makes to a particular servlet.  You will,
at any point have many sessions for 1 instance of your servlet.  

I believe a session will be created when you call getSession() if one does
not already exist (it's specified in the spec and I'm too lazy to look it
up).

-----Original Message-----
From: Chappell, Simon P [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 16, 2003 12:40 PM
To: Struts Mailing List (E-mail)
Subject: [Semi OT] When does a servlet get a session?


OK, I have a servlet running alongside my Struts application and it is
basically used to start (from the init() method) a separate network listener
for handling network requests from a number of PLC units that are incapable
of generating HTTP traffic, only straight socket connections, blasting a
wierd protocol called DF1 and then waiting for a reply.

We have all of that working. But now we want to store a piece of information
in the servlet session so that we can load-balance on a WAS cluster. When we
call back into the servlet to store the information, our session information
is null.

My question is ... when does a servlet get a session and can we force one
from the init method? This servlet never gets called, so we never have an
HttpSession. Can we force it to create an HttpSession?

Simon

-----------------------------------------------------------------
Simon P. Chappell                     [EMAIL PROTECTED]
Java Programming Specialist                      www.landsend.com
Lands' End, Inc.                                   (608) 935-4526

"Never give in - never, never, never, never, in nothing great or small,
large or petty, never give in except to convictions of honor and good
sense." - Sir Winston Churchill

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-----------------------------------------
This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to