Hello Craig,

������, 1999��7��8��, you wrote:

CRM> Mukul Gandhi wrote:

>> Hi Craig,
>> u said regarding HttpSession object created in doPost() or doGet(). I know
>> these facts(Pl correct if I am wrong) -
>> 1. If many users are invoking the same servlet, then a Httpsession object
>> is created for each user. These session objects for different users are
>> existing in various threads(1 thread per servlet invocation) and don,t
>> share anything.

CRM> Yes, a unique session object is created for each user.  Objects you store in a
CRM> session for one user are not shared with session objects stored in other sessions
CRM> for other users.

CRM> No, you cannot assume that this fact *alone* makes you thread-safe, because you
CRM> cannot assume that the same user will not trigger more than one request at the
CRM> same time (which would be handled by different threads accessing the same session
CRM> object).

>>
>> 2. The Servlet environment identifies the sessions for users by means like
>> persistent cookies or url rewwriting mechanisms. If a particular user wants
>> to store some java object in his session object, it is done by calling
>> session.putValue(String,Object) method.

CRM> Yes, this is correct.  Of course, there is an obligation on the servlet developer
CRM> to cooperate with this mechanism if there is any chance that your users do not
CRM> have cookies enabled.  You must pass any URL that points back to your site
CRM> through the response.encodeURL() method to actually perform the rewriting.

>>
>> I am reading Jason Hunter's book. Its very well written.
>>

CRM> I agree ... this book is a tremendous help in understanding how to program for
CRM> the servlet environment.

    Could you tell me where can I get this book? to download it or
    book it? it needs money?
Best regards,
 DragonTown                            mailto:[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to