spring mvc 處理html,css,js等靜態檔案

來源:互聯網
上載者:User

標籤:

在spring mvc,可以使用<mvc:resources/>標籤來處理css,js,images等檔案,使用方法如下:

<mvc:resources location="/WEB-INF/pages/welcome/" mapping="/welcome/*.html"/>
<mvc:resources location="/WEB-INF/pages/welcome/js/" mapping="/welcome/js/**"/>
<mvc:resources location="/WEB-INF/pages/welcome/images/" mapping="/welcome/images/**"/>
<mvc:resources location="/WEB-INF/pages/welcome/css/" mapping="/welcome/css/**"/> 

spring mvc 處理html,css,js等靜態檔案

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.