SpringBoot 页面加载Whitelabel Error Page
问题描述
初次接触SpringBoot开发,使用控制器的转发视图的时候报的异常感觉是路径问题,但是不知道怎么改
页面显示 Whitelabel Error Page
No mapping found for HTTP request with URI [/student/classpath:/templates/student/index.html] in DispatcherServlet with name 'dispatcherServlet'
@Controller
@RequestMapping(value = "/student")
public class StudentController {
@Autowired
StudentService studentService;
@RequestMapping(value = "/index")
public String index(){
return "student/index";
}
#视图
spring.mvc.view.prefix=classpath:/templates/
spring.mvc.view.suffix=.html
spring.mvc.static-path-pattern=/static/**
springboot版本是2.0.6,求解答
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你这是要用模板引擎么?建议看一下我springboot系列的文章,地址:https://somta.com.cn/blog/lis...