Cannot resolve directory ‘xxx‘ / Cannot resolve MVC view ‘xxx‘

使用SpringBoot做文件上传,报错:message=Error resolving template [form/form_layouts], template might not exist or might not be accessible by any of the configured Template Resolvers, path=/form_layouts}]
资源目录:
在这里插入图片描述
Controller

@Controller
public class FromTestController {
    @GetMapping("/form_layouts")
    public String form_layouts(){
        return "form/form_layouts";
        //提示Cannot resolve directory 'xxx' / Cannot resolve MVC view 'xxx'

    }
}

访问页面
Cannot resolve directory ‘xxx‘ / Cannot resolve MVC view ‘xxx‘_第1张图片
解决方法:

@Controller
public class FromTestController {
    @GetMapping("/form_layouts")
    public String form_layouts(){
        return "../form/form_layouts";
    }
}

你可能感兴趣的:(java)