spring
kawhine
这个作者很懒,什么都没留下…
展开
-
SpringBoot项目运行报错SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.
SpringBoot报错: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.原创 2021-11-17 17:34:52 · 322 阅读 · 0 评论 -
SpringBean的生命周期和作用域
通过测试知道Bean默认是singleton单例的。 想要通过getBean获取不同的对象需要在bean标签中添加scope属性设置为"prototype"。 request:在一次Http请求中,容器会返回该Bean的同一个实例。而对不同的Http请求会产生新的bean,而且该bean仅在当前Http 请求内有效。代表同一次请求共享一个Bean对象 session:在一次Http Session中,容器会返回该Bean的同一个实例。而对不同的Session请求会创建新的bean,而且该bea原创 2021-11-12 22:56:39 · 239 阅读 · 0 评论