相同的配置,springboot 2.0.0 能正常访问到jsp,2.1.3出现not found错误

2.1.3配置如下,启动时,Tomcat没有执行Spring初始化,[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext:

    
        org.springframework.boot
        spring-boot-starter-parent
        2.1.3.RELEASE
         
    

	
	   
        
            org.springframework.boot
            spring-boot-starter-web
        
        
            org.springframework.boot
            spring-boot-starter-tomcat
        
        
        
        
            org.apache.tomcat.embed
            tomcat-embed-jasper
        
	

jsp访问错:

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sat Apr 13 20:25:10 CST 2019
There was an unexpected error (type=Not Found, status=404).
No message available

后台异常:

019-04-13 20:25:10.454  INFO 9788 --- [nio-8085-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-04-13 20:25:10.454  INFO 9788 --- [nio-8085-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2019-04-13 20:25:10.465  INFO 9788 --- [nio-8085-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 11 ms
2019-04-13 20:25:10.528  WARN 9788 --- [nio-8085-exec-1] o.s.w.s.r.ResourceHttpRequestHandler     : Path with "WEB-INF" or "META-INF": [WEB-INF/pages/test.jsp]

2.0.0 配置依赖包跟上面没有变化,但是JSP访问正常:

    
        org.springframework.boot
        spring-boot-starter-parent
        2.0.0.RELEASE
         
    


原因未知:但是查看了引用包的版本是有差别的,前者spring.version 5.1.5.RELEASE 后者5.0.4.RELEASE,两个版本的TOMCAT包前者是9.0.16后者是8.5.28.

等待以后找到原因补上。

 

你可能感兴趣的:(WEB应用,JAVA,springboot,SpringBoot)