o.s.w.s.r.ResourceHttpRequestHandler:Path with "WEB-INF" or "META-INF": [WEB-INF/jsp/index.jsp]

springboot项目,使用jsp作为前端页面。在application.yml配置了jsp所在位置

spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp

o.s.w.s.r.ResourceHttpRequestHandler:Path with

@Controller
@RequestMapping(value = "/user")
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping(value = "/getAllUser")

    public String getAllUser(){
        //return userService.getAllUser();
        return "index";
    }

}

项目启动spring boot时报错,访问http://localhost:8080/user/getAllUser报错找不到页面

原因是:spring boot默认不使用jsp,需要在pom中引用jsp的编译程序:


            javax.servlet
            jstl
        

        
            org.apache.tomcat.embed
            tomcat-embed-jasper
            provided
        

访问成功

o.s.w.s.r.ResourceHttpRequestHandler:Path with

你可能感兴趣的:(springboot,jsp,springboot)