在spring mvc 中读取配置文件(porperties)的信息
String realPath= ContextLoader.getCurrentWebApplicationContext().getServletContext().getRealPath("/WEB-INF/spring/config.properties") ; Properties props=new Properties(); props.load(new FileInputStream(realPath)); realPath=props.getProperty(Constantsw.UPLOAD_PATH);
posted on 2013-12-12 16:21 passer1991 阅读(444) 评论(0) 编辑 收藏 举报