1 首先把下面库加上

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.13.RELEASE</version>
    </parent>

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
</dependency>

2.其次去 org.springframework.boot.autoconfigure.web.ResourceProperties

private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
            "classpath:/META-INF/resources/", "classpath:/resources/",
            "classpath:/static/", "classpath:/public/" };

系统默认的是以这几个开头。

3.建立文件 index.html 是默认页面  启动http://localhost:8020,端口口设置是在application.yml文件里设置的

Spring boot 访问静态资源

4.启动http://localhost:8020 

Spring boot 访问静态资源

5.点击login

Spring boot 访问静态资源

 

相关文章:

  • 2021-12-09
  • 2021-10-29
  • 2021-05-28
  • 2021-08-13
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-02
  • 2021-12-01
  • 2021-11-20
  • 2021-11-20
  • 2021-11-20
  • 2021-11-20
  • 2021-06-26
相关资源
相似解决方案