官方文檔:html
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.htmlweb
依然訪問不到。。。spring
其實官方解釋沒有說起一點,就是不能使用@EnableWebMvc,固然若是Spring Boot在classpath裏看到有 spring webmvc 也會自動添加@EnableWebMvc mvc
若是@EnableWebMvc了,那麼就會自動覆蓋了官方給出的/static
, /public
, META-INF/resources
, /resources
等存放靜態資源的目錄。而將靜態資源定位於src/main/webapp
。當須要從新定義好資源所在目錄時,則須要主動添加上述的那個配置類,來Override addResourceHandlers
方法。app
訪問成功!!!webapp