Path with "WEB-INF" or "META-INF": [WEB-INF/jsp/welcome.jsp]解决办法

@GetMapping("/")
public String welcome(Map model) {
	model.put("time", new Date());
	model.put("message", this.message);
	return "welcome";
}

application.properties 如下配置:
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp

但是浏览器访问提示:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
查看控制台:
Path with “WEB-INF” or “META-INF”: [WEB-INF/jsp/welcome.jsp]

网上查原因spring boot不提倡用jsp,需要在pom.xml中加入以下依赖就可以了。

   
        org.apache.tomcat.embed
        tomcat-embed-jasper
    
    
        javax.servlet
        jstl
    

加完依赖注意刷新maven.

你可能感兴趣的:(spring,boot,Path,with,or)