I've got an idea for storing various data and objects required by an
application, not in the ServletContext or HttpSession itself (via
setAttribute and getAttribute), but in a bean that can manage them. This
will simplify the jsp code and also prevent runtime exceptions when
retrieving objects from the context.

One question I have, though, is: should these objects be allowed to
store a reference to their context? For example, I can see where a
session-scoped bean would like to have a reference to the HttpSession,
so that it can refer to other session-scoped objects and data, or even
application-scoped objects and data. If it implements
HttpSessionBindingListener and uses the valueUnbound() method to release
its reference to the HttpSession that created it, is there any danger in
this?


--
Jeff Sahol
[EMAIL PROTECTED]

===========================================================================
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