I recommend you use the singleton design pattern for the bean; and make the bean application scope. You declare the bean as application scope - so it's shared across the entire JVM.
<jsp:useBean id="xxx" class="xxx" scope="application"> -----Original Message----- From: A mailing list about Java Server Pages specification and reference [mailto:[EMAIL PROTECTED]]On Behalf Of Jan Aren? Sent: Tuesday, June 11, 2002 9:45 AM To: [EMAIL PROTECTED] Subject: A way to share a bean to all users? I have some jsp pages that I would like to log. I have made a bean that does that, but is there a way to make the server use the same bean for all sessions? Since a logger opens a file and write to it, there is a small possibility that user B tries to open the logfile when user A already have opened it and user B would get an Exception that the file could not be opened, right? Can the webserver "get" the bean and all users interact with the same javaclass? /Jan =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
