前段時間研究springboothtml
發現使用Application類啓動的話, 能夠進入Controller方法而且返回數據,可是不能跳轉到WEB-INF目錄下網頁,前端
前置配置java
會致使問題:web
打包成jar包 使用java -jar springboot.jar, 訪問前端 同樣會404spring
缺陷彌補方案 ,打包成 war包, 使用java -jar springboot.war 就OK了 tomcat
<resource>
<directory>src/main/webapp</directory>
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>springboot
進行webapp目錄配置後, mvc
使用啓動類啓動 和 打包成jar包 均可以正常訪問了app
O(∩_∩)O哈哈~webapp
修改了配置 記得 clean 一下哦