Another difference I've found useful:

The HttpSession object can die unexpectedly, especially from a timeout.
Many web servers/servlet engines will time a session out after, say, a
half-hour.  Also, the user can quit the browser.

What I did was to create my own UserSession bean.  I initialize it with
the HttpSession.  The UserSession then registers itself as an
HttpBindingSessionListener.  It gets notified when the HttpSession
dies.  This lets the UserSession save any data it needs to, and also
close any connections that it may be keeping open.

Cheers,
Tom

Howard Lee wrote:
>
> Hi,
>
> I'm new to JSP, and have a question about how I should go about doing a
> session management. I'm used to creating a HttpSession object and do
> putValue and getValue on it, and I've seen a JSP example that uses a java
> bean to store and retrieve values. It seems to me that if I use <jsp:useBean
> scope="session"> to a bean, this is pretty much what an HttpSession object
> is. Am I right about this or I'm mistaken? Thanks.
>
> howard
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to