First, the realization principle
In the Servlet3 protocol specification, the resources contained in the JAR file /META-INFO/resources/
can be accessed directly.
2. Examples
As shown in the figure below, it is a new Spring Boot Starter project I created: zimug-minitor-threadpool, which is used to implement a configurable and observable thread pool. Among them pool.html
is the monitoring page of the running status of the thread pool. Put it in the position shown in the picture below.
Once the location is correct, package the project. My final packaging result is zimug-minitor-threadpool-1.0.jar
. When a Spring Boot project needs to reference this jar package, it can be imported directly through maven coordinates. Access the service /pool.html
to obtain the thread pool configuration information and runtime status information of the current SpringBoot service.
In this way, it is feasible to access the static resources in the jar package.
Welcome to pay attention to my announcement number: Antetokounmpo, reply 003 and present the PDF version of the column "The Way of Docker Cultivation" where this article is located, and more than 30 excellent docker articles. Antetokounmpo Blog: zimug.com
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。