lyyb2001

只是为方便自己找记录而已
posts - 57, comments - 27, trackbacks - 0, articles - 5
  BlogJava :: 首页 :: 新随笔 :: 联系 ::  :: 管理

JBOSS 如何读取properties文件

Posted on 2016-11-03 18:17 skycity 阅读(226) 评论(0)  编辑  收藏

通过Application

ApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext();

     classPath = classPathXmlApplicationContext.getResource("classpath:config.properties").getFile().getPath();

        if(classPath.indexOf("WEB-INF")>0){

            classPath = classPath.substring(0,classPath.indexOf("WEB-INF")+7)+"/classes/"+xmlFile;

        }

 



Lyyb2001

只有注册用户登录后才能发表评论。


网站导航: