其他每个bean都import Pool.ConnPool
!!!

解决方案 »

  1.   

    问题在于:我是在JSP页面初始化的连接池。如果在bean里import的话,就需要NEW一个新实例,然后调用其方法,就不能用JSP页面设置的application的连接池了
      

  2.   

    连接池的Bean的实例应该维持只有一个啊!!
    这样就可以了
    public class ConnPool {
       static ConnPool instance;
       public ConnPool getInstance() {
         if (instance == null) then {
            ConnPool cp = new ConnPool(); 
         } else {
            cp = instance;     
         }
         return cp;
       }
    }