当前位置:网站首页>The web project accesses static resources inside the jar
The web project accesses static resources inside the jar
2022-08-09 17:48:00 【51CTO】
I. Implementation principle
In the Servlet3 protocol specification, included in the JAR file/META-INFO/resources/
Resources under the path 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.Wherepool.html
is the monitoring page for the running status of the thread pool.Put it in the position shown in the picture below.
Once the location is correct, pack the project.My final wrapping result iszimug-minitor-threadpool-1.0.jar
.When a Spring Boot project needs to reference this jar package, it can be imported directly through maven coordinates. of access service/pool.html
You can get the thread pool configuration information and runtime status information of the current SpringBoot service.
Explain that in this way, it is feasible to access the static resources in the jar package.
If you find it helpful, I look forward to your attention and forwarding, your support is my creative driving force!Welcome to the public account: Antetokounmpo
边栏推荐
猜你喜欢
随机推荐
Go语言基础(十二):并发编程
opacity和rgba的区别
Go语言基础(十四):单元测试
Codeforces Round #808 (Div. 2)||沉淀
(一)BFC
C语言的常量和操作符
Redis学习(一.redis中的数据结构)
文件IO及其函数使用
2. Creating Interactive Maps
第五章:可视化地理空间数据
二维数组的探究
辨析fork与vfork
学习编程的第三天
Office365 AzureAD Intune 配置
2021深圳杯A题思路 火星探测器着陆控制方案
MySQL必知必会(一)
Heap series_0x08: NT heap debug support_Discover now debug support (DPH)
C语言知识细节点(一)
为什么四个字节的float表示的范围比八个字节的long要广
3. Using Earth Engine Data