Use the removeAttribute()-method to remove a specific object from the
user's session.
HttpSession session = request.getSession(true);
session.setAttribute("name", new Object()); // add an empty object
session.removeAttribute("name"); // remove the object added on the previous
line
Hope this helps,
[ Matthias Carlsson ]
[ Programmer (Java, CGI/Perl, Javascript, HTML) ] [ Web Designer ]
[ E-Mail : [EMAIL PROTECTED] ] [ ICQ: 1430647 ]
[ http://home1.swipnet.se/~w-18931/programming/ ]
> -----Ursprungligt meddelande-----
> Fran: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]For Duong Tung Lam
> Skickat: den 15 oktober 2000 17:03
> Till: [EMAIL PROTECTED]
> Amne: Session Tracking API problem!!
>
>
> Hello everybody! I'm learning Java Servlet by myself so I don't
> have much experience.
> I used "Session Tracking API" method to save my web pages
> infomations into server memory.
> But, unlike COOKIES, I cannot remove a NAME (only one) from
> HttpSession. When I used HttpSession.invalidate(),
> all NAMES and its VALUES immediate destroyed!!
>
> I have used the following solution: I get all names and values
> into Servlet array of strings, EXCEPT the name I want to remove.
> After that,
> I invalidate() session and put array into session again.
>
> I FEEL THIS SOLUTION IS NOT GOOD, DO YOU HAVE OTHER SOLUTION?
>
> PLEASE tell me if you know! THANKS YOU VERY MUCH!
>
> __________________________________________________________________
> _________
> 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
___________________________________________________________________________
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