Spring Boot
Rainbow Cat
Because we are born with nothing,so we can have everything.
展开
-
Spring Boot 请求/actuator/beans 无法访问 返回404 ?
问题复现 在保证项目加入了spring-boot-starter-actuator依赖,并成功启动后。通过浏览器进行访问,返回如下图结果: 开始排查 1. 查看日志 通过日志可发现 /actuator 只给我们暴露了两个端点,我们不妨直接访问 /actuator 进行查看 2. 浏览器访问 /actuator 到此我们可以发现,Spring Boot 启动后默认只开放了info、hea...原创 2019-11-14 10:02:36 · 1038 阅读 · 0 评论 -
浅谈为啥 Spring 的 Bean 默认是单例的?
前言 熟悉 Spring开发的朋友都知道现在 Spring 提供了 6 种 scope,分别是: singleton prototype request session application websocket 如下图是官方文档上的截图,感兴趣的朋友可以进去看看这六种分别有什么不同。今天要介绍的是这六种中的前两种,也是 Spring最初提供的 bean scope:singleton 和 p...原创 2019-11-13 21:02:27 · 753 阅读 · 1 评论