RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
HttpServletRequest request = (HttpServletRequest) requestAttributes.resolveReference(RequestAttributes.REFERENCE_REQUEST);
String imagein =request.getSession().getServletContext().getResourceAsStream("/WEB-INF/classes/ftl/createCode/baseProve.png");
System.out.println(imagein);
java 获取web项目中的文件路径
最新推荐文章于 2023-09-15 14:35:47 发布