一.spring boot的web應用開發,是基於spring mvc
二.Spring boot 在spring默認基礎上,自動配置添加了以下特性:
1. 包含了ContentNegotiatingViewResolver和BeanNameViewResolver beans。
2. 對靜態資源的支持,包括對WebJars的支持。
3. 自動註冊Converter,GenericConverter,Formatter beans。
4. 對HttpMessageConverters的支持。
5. 自動註冊MessageCodeResolver。
6. 對靜態index.html的支持。
7. 對自定義Favicon的支持。
8. 主動使用ConfigurableWebBindingInitializer bean
三.模板引擎的選擇
FreeMarker
Thymeleaf
Velocity (1.4版本之後棄用,Spring Framework 4.3版本之後棄用)
Groovy
Mustache
註:jsp應該儘量避免使用,原因如下:
jsp只能打包為:war格式,不支持jar格式,只能在標準的容器裡面跑(tomcat,jetty都可以)
內嵌的Jetty目前不支持JSPs
Undertow不支持jsps
jsp自定義錯誤頁面不能覆蓋spring boot 默認的錯誤頁面
四.FreeMarker Demo
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
微服務架構的分布式事務解決方案,第二方案已更新完成!
詳情請登錄龍果學院:www.roncoo.com