Spring-boot load local Static resource file path configuration __spring-boot

Source: Internet
Author: User
1.spring boot the path to the default load file is
/meta-inf/resources/
/resources/
/static/
/public/
Below these directories, of course, we can also see from the Spring boot source
Java code private static final string[] Classpath_resource_locations = {"Classpath:/meta-inf/resources/", "class Path:/resources/"," classpath:/static/"," classpath:/public/"};
All of the local static resources are configured under the Classpath, not under WebApp.

2.
HTML code    <%@ page language= "java"  contenttype= "Text/html; charset=utf-8"         pageencoding= "Utf-8"%>   <! doctype html>   <%@ taglib prefix= "C"  uri= "Http://java.sun.com/jstl/core"% >  
3. Details of the directory structure are attached

Project Address Https://github.com/leelance/spring-boot-all

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.