其中DAO_CONFIG_FILE为绝对地址
我们必须设置locator.setConfigLocation("file"),默认是用Classpath的方式,但Classpath方式在web project中总会出现这样那样的问题
否则会出现空指针异常


public static synchronized HashMap load()...{
HashMap map=new HashMap();
JFigLocator locator=new JFigLocator(DAO_CONFIG_FILE);
try ...{
locator.setConfigLocation("file");
} catch (JFigException e1) ...{
e1.printStackTrace();
} JFigIF daoConfig=JFig.getInstance(locator);
Properties prop=daoConfig.getSectionAsProperties("DAO");
689

被折叠的 条评论
为什么被折叠?



