I found another case where the servlet engine is creating TWO instance of an
application level variable. Here is the class:

public class Test implements  Serializable, ServletContextListener{
    ServletContext application;
    public void contextInitialized(ServletContextEvent event) {
        System.out.println(this + " - contextInitialized()"); //prints
memory address
        this.application = event.getServletContext();
    }
    public void doSomething(){
      System.out.println(this + " - doSomething()"); //prints DIFFERENT
memory address
      application.getInitParameter("dsn"); //produces null pointer exception
    }
    public void contextDestroyed(ServletContextEvent event) {}
}

Should this print TWO memeory addresses?

Dave Ford
Smart Soft - The Java Training Company
http://www.smart-soft.com

___________________________________________________________________________
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

Reply via email to