01- static resource access

Static resource category:

  SpringBoot default setting static resource access are two types: JAR imported static resources and still add their own resources in the project

How to access static resources jar package

  • SpringBoot understood by viewing the source code, the access path to jar package /webjars/**, which is mapped to the pathclasspath:/META-INF/resources/webjars/
  • The map can be understood as, if you want to access resources in the jar, you need to enter the following address in your browser:http:ip:port/webjars/具体的jar资源路径
  • classpath:/META-INF/resources/webjars/Mapped to the web project all the jar

    as you can see, all of the jar has a META-INFdirectory
  • Access For example, access

How to access static resources you added

There are five kinds of access path:
'' '
the CLASSPATH: / META-INF / Resources /
the CLASSPATH: / Resources /
the CLASSPATH: / static /
the CLASSPATH: / public /
/: root of the current path of the project (233, I was not Mozhun this position)
''

Guess you like

Origin www.cnblogs.com/sout-ch233/p/12628915.html
Recommended