1,启动错误
关键错误(丢失了web容器的工厂,也就是说我们并没有把它作为一个web应用来启动):
org.springframework.context.ApplicationContextException:
Unable to start embedded container;
nested exception is org.springframework.context.ApplicationContextException:
Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
解决办法:
在相应的application类上,增加注解:@SpringBootApplication
2,解决jsp访问404的问题
由于Spring boot使用的内嵌的tomcat,而内嵌的tomcat是不支持jsp页面的,所有需要导入额外的包才能解决。
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
然后再重启测试就OK了