EM> Using a singleton for sharing data between web applications is prone to EM> error. Singleton's are only unique per classloader and the Servlet Spec (at EM> least the 2.2 spec) only specifies that each web application must have its EM> own classloader for instances created from the Web-Inf/classes and EM> Web-Inf/lib directories. Thus, if the singleton implementation class file is EM> located in these directories, each web application will have a reference to EM> a distinct instance.
EM> In Tomcat, you may place the class file in classpath directory that spans EM> all applications - lib/container for example. Any instance created from the EM> shared classpath will be loaded by a single classloader regardless of the EM> web application. However, you should note that servlet container classpath EM> directories differ across implementations and you may not receive the EM> desired behavior in another servlet container. thanks Erik >> ----- Original Message ----- >> From: "Yuriy Stepovoy" <[EMAIL PROTECTED]> >> To: <[EMAIL PROTECTED]> >> Sent: Friday, April 26, 2002 1:03 PM >> Subject: share data between 2 and more webapp >> >> >> > Hello ALL. >> > >> > can anyone explain how share data between 2 and more webapp existed in >> servlet >> > container ? >> > >> > >> > -- >> > Best regards, >> > Yuriy >> > >> > >> EM> ___________________________________________________________________________ >> > 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 >> > >> > >> >> EM> ___________________________________________________________________________ >> To unsubscribe, send email to [EMAIL PROTECTED] and include in the EM> 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 >> >> EM> ___________________________________________________________________________ EM> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body EM> of the message "signoff SERVLET-INTEREST". EM> Archives: http://archives.java.sun.com/archives/servlet-interest.html EM> Resources: http://java.sun.com/products/servlet/external-resources.html EM> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html -- Best regards, Yuriy ___________________________________________________________________________ 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
