String path = ClassUtils.getDefaultClassLoader().getResource("classpath:static/QRCode.png").getPath(); File file1 = ResourceUtils.getFile("classpath:static/QRCode.png"); // ClassPathResource classPathResource = new ClassPathResource("classpath:static/QRCode.png"); String basepath= URLDecoder.decode(file1.getPath(),"utf-8");//这样就能解决掉那个空格的问题了。
spring中静态资源的加载
最新推荐文章于 2024-01-29 08:45:12 发布