SpringBoot 中支持 jsp 和 thymeleaf
- 官方默认支持
thymeleaf,并且也推荐使用 - 如果想支持
jsp需要额外的配置
SpringBoot 中支持 jsp 和 thymeleaf
thymeleaf,并且也推荐使用jsp 需要额外的配置SpringBoot中提供了两种注入方式:注入基本属性,对象注入
Spring Boot helps you to create stand-alone, production-grade Spring-based Applications that you can run. We take an opinionated view of the Spring platform and third-party libraries, so that you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration.
springboot框架=SpringMVC+Spring
拦截器(Interceptor ) 拦截、中断的意思,类似于 JavaWeb中的Filter,但不如Filter拦截的范围大。
通过将控制器中的通用代码放在拦截器中执行,减少控制器中的代码冗余。
由于在 web.xml中配置SpringMVC的核心servlet(DispatherServlet)时 url-pattern 配置为 “/“,因此会导致项目中所有 / 开头的请求,均被作为控制器请求处理,这样会导致项目中的静态资源被(css,js,img)拦截。