spring mvc 项目 系统在那个的相对路径

来源:互联网 发布:等离子切割机编程方法 编辑:程序博客网 时间:2024/04/29 22:08
          String realPath= ContextLoader.getCurrentWebApplicationContext().getServletContext().getRealPath("/WEB-INF/spring/config.properties") ;         Properties props=new Properties();         try {            props.load(new FileInputStream(realPath));            realPath=props.getProperty(Constantsw.UPLOAD_PATH);
0 0