如图,获取user.png: 代码实现: //文件路径,此处static前不能加/,否则解析不到try { //此处的static前不能加/!!! file = ResourceUtils.getFile(ResourceUtils.CLASSPATH_URL_PREFIX + "static/images/user.png"); ... } catch (FileNotFoundException e) { e.printStackTrace();} 相关文章: 2022-12-23 2022-01-07 2021-06-24 2021-07-25 2022-12-23 2021-11-27 2022-12-23 2022-12-23