springboot静态内容获取文件失败
Fail to get the file in springboot static content
我这样写路径时获取不到spring启动静态文件:
private static final String FILE_PATH = "/resources/data/user.json";
原来是FileNotFound。路径应该怎么写?
尝试使用ClasspathResource
Resource resource = new ClassPathResource("/static/data/user.json");
File file = resource.getFile();
我这样写路径时获取不到spring启动静态文件:
private static final String FILE_PATH = "/resources/data/user.json";
原来是FileNotFound。路径应该怎么写?
尝试使用ClasspathResource
Resource resource = new ClassPathResource("/static/data/user.json");
File file = resource.getFile();