這篇“springboot中如何實現默認靜態路徑”文章的知識點大部分人都不太理解,所以小編給大家總結了以下內容,內容詳細,步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“springboot中如何實現默認靜態路徑”文章吧。
類ResourceProperties.class
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = new String[]{"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"}; private String[] staticLocations; public ResourceProperties() { this.staticLocations = CLASSPATH_RESOURCE_LOCATIONS; this.addMappings = true; this.chain = new ResourceProperties.Chain(); this.cache = new ResourceProperties.Cache(); }
根據構造方法可知, staticLocations
等于默認的CLASSPATH_RESOURCE_LOCATIONS
, 也即"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"
classpath即為我們如下圖所示的resource文件夾
以上就是關于“springboot中如何實現默認靜態路徑”這篇文章的內容,相信大家都有了一定的了解,希望小編分享的內容對大家有幫助,若想了解更多相關的知識內容,請關注創新互聯行業資訊頻道。
文章題目:springboot中如何實現默認靜態路徑-創新互聯
本文路徑:http://newbst.com/article8/dipdop.html
成都網站建設公司_創新互聯,為您提供動態網站、網站營銷、微信小程序、域名注冊、做網站、網站內鏈
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯