当前位置:网站首页>web项目访问引用jar内部的静态资源
web项目访问引用jar内部的静态资源
2022-08-10 22:14:00 【字母哥哥】
一、实现原理
web项目访问引用jar内部的静态资源,在Servlet3协议规范中,包含在JAR文件/META-INFO/resources/
路径下的资源可以直接访问。
二、举例说明
如下图所示,是我新建的一个Spring Boot Starter项目:zimug-minitor-threadpool,用于实现可配置、可观测的线程池。其中pool.html
就是线程池运行状态的监控页面。放在如下图所示的位置。
位置放置正确之后,将项目打包。我的最终打包结果是zimug-minitor-threadpool-1.0.jar
。当一个Spring Boot项目需要引用这个jar包的时候,直接通过maven坐标引入即可。访问服务的/pool.html
即可获取当前SpringBoot服务的线程池配置信息,以及运行时状态信息。
说明按照这种方式,访问jar包里面的静态资源是可行的。
如果您觉得有帮助,期待您的关注、转发,您的支持是我不接的创作动力! 更多精彩内容欢迎关注我的公众号!
边栏推荐
- Shell编程规范与变量
- What would happen if disconnecting during the process of TCP connection?
- 财务年报怎样翻译,为什么要选择专业翻译公司?
- CFdiv2-Beautiful Mirrors-(期望)
- CIKM2022 | Sequence Recommendation Based on Bidirectional Transformers Contrastive Learning
- win系统下pytorch深度学习环境安装
- LeetCode Daily Question (1573. Number of Ways to Split a String)
- 2021 IDEA creates web projects
- Introduction to the use of counter instructions in Rockwell AB PLC RSLogix5000
- 合并k个已排序的链表
猜你喜欢
LeetCode每日两题02:反转字符串中的单词 (均1200道)
从斐波那契 - 谈及动态规划 - 优化
Thread State 详解
IM 即时通讯开发如何设计图片文件的服务端存储架构
How to translate financial annual report, why choose a professional translation company?
Merge k sorted linked lists
企业云存储日常运行维护实践经验分享
BM7 list entry in central
3598. 二叉树遍历(华中科技大学考研机试题)
RK3399 platform development series explanation (kernel-driven peripherals) 6.35, IAM20680 gyroscope introduction
随机推荐
2021IDEA创建web工程
使用 Cloudreve 搭建私有云盘
pytorch tear CNN
August 10, 2022: Building Web Applications for Beginners with ASP.NET Core -- Creating Web UIs with ASP.NET Core
学会开会|成为有连接感组织的重要技能
Distribution Network Expansion Planning: Consider Decisions Using Probabilistic Energy Production and Consumption Profiles (Matlab Code Implementation)
STL-deque
LeetCode Daily Question (1573. Number of Ways to Split a String)
艺术与科技的狂欢,阿那亚2022砂之盒沉浸艺术季
如何成为一名正义黑客?你应该学习什么?
xshell (sed 命令)
xshell (sed command)
How does the Weiluntong touch screen display the current value of abnormal data while alarming?
An article to teach you a quick start and basic explanation of Pytest, be sure to read
美味的佳肴
shell脚本
Regular expression of shell programming and text processor
CIKM2022 | 基于双向Transformers对比学习的序列推荐
商家招募电商主播要考虑哪些内容
《DevOps围炉夜话》- Pilot - CNCF开源DevOps项目DevStream简介 - feat. PMC成员胡涛