Spring Boot classpath

前端 未结 2 1180
梦如初夏
梦如初夏 2021-02-04 00:21

In the Spring Boot\'s docs here, about serving static content, it says:

By default Spring Boot will serve static content from a directory called /static

2条回答
  •  攒了一身酷
    2021-02-04 00:44

    The classpath also contains additional libraries (JARs), which also can have a static folder, which would then be included for serving static resources. So if the documentation would only state the folder src/main/resources/static, it would be incomplete.

    Ad 2: As long as you don't mess with the default Maven configuration, then it's safe to assume this.

    Ad 3: Maybe start with the official Oracle documentation: https://docs.oracle.com/javase/8/docs/technotes/tools/windows/classpath.html. Hint: Of course, it's not only the contents of the resources folder, which are in the classpath, but also of course all compiled classes, hence its name.

提交回复
热议问题