我在weblogic 里面设置了启动类,在启动类里面给一些变量赋了值,但是当我引用这些变量的时候为什么就没的值啊?
这是启动类,我是给ConnectionManager.type这个静态的变量在启动时赋了个值
public class WLsT3Startup implements T3StartupDef {
public String startup(String arg0, Hashtable arg1) throws Exception {
ConnectionManager.type="dao-type";
System.out.println("::::::type::::::::"+ConnectionManager.type);
}
public void setServices(T3ServicesDef arg0) {
}
}
在weblogic控制台也有输出:::::::type::::::::dao-type
但是我这样写的时候
public class Test {
public static void main(String[] args) {
System.out.println(ConnectionManager.type);
}
}
就输出个null呢?
有哪位高手知道怎么在weblogic启动时给变量赋值,以及怎么来得到这个变量的值啊?
问题补充:
我是想在weblogic启动的时候初始化一些变量的值,但是weblogic启动之后,我在去输出的时候就为null了