欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Spring Boot 2.0 設置網站默認首頁的實現(xiàn)代碼

 更新時間:2018年04月02日 17:24:48   作者:tiandong  
這篇文章主要介紹了Spring Boot 2.0 設置網站默認首頁的實現(xiàn)代碼,需要的朋友可以參考下

Spring Boot設置默認首頁,方法實驗OK如下

附上Application啟動代碼

/**
* @ClassName Application
* @Description Spring-Boot website啟動類
* @author kevin.tian
* @Date 2018-03
* @version 1.0.0
*/
@SpringBootApplication
@PropertySource(value={  
"file:${APP_HOME_CONF}/overpayment-web/overpayment-web.properties",  
"file:${APP_HOME_CONF}/overpayment-web/db.properties"
})
@ImportResource({"file:${APP_HOME_CONF}/overpayment-web/spring.xml"})
public class Application extends SpringBootServletInitializer {
public static void main(String[] args)
{
try {
SpringApplication.run(Application.class);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
}

1. 放置默認首頁default.html,

位置在/src/main/resources/static/default.html

2. 增加IndexController控制器,設置index路由

 

測試結果,如下

 

下面看下Spring Boot 2.0 新特性

說了這么多,Spring Boot 2.0 和 1.0 比都有哪些變動和新特性呢?

•JDK最低要求1.8+,并支持1.9;
•支持Spring webflux/webflux.fn響應式的web編程;
•提供Spring Data Cassandra, MongoDB, Couchbase和Redis的響應式自動配置及starter POMs;
•支持嵌入式的Netty;
•HTTP/2的支持:Tomcat, Undertow and Jetty;
•全新的體系結構,支持Spring MVC、WebFlux和Jersey;
•增強了Micrometer集成,以Atlas, Datadog, Ganglia, Graphite, Influx, JMX, New Relic, Prometheus, SignalFx, StatsD and Wavefront為基礎的度量指標;
•Quartz調度支持;
•極大簡化了安全自動配置;

總結

以上所述是小編給大家介紹的Spring Boot 2.0 設置網站默認首頁的實現(xiàn)代碼,如果大家有任何疑問請給我留

言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網站的支持!

相關文章

最新評論