SpringBoot的坑-01
来源:互联网 发布:阶乘c语言编程 编辑:程序博客网 时间:2024/06/07 23:36
SpringBoot里面用这个方法ApplicationContext ac=ContextLoader.getCurrentWebApplicationContext();拿不到ac,好像只能这么拿ac
import org.springframework.beans.BeansException;import org.springframework.context.ApplicationContext;import org.springframework.context.ApplicationContextAware;import org.springframework.stereotype.Component;@Componentpublic class ApplicationContextProvider implements ApplicationContextAware { private static ApplicationContext applicationContext; @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { ApplicationContextProvider.applicationContext = applicationContext; } public static ApplicationContext getContext() { return applicationContext; }}
阅读全文
0 0
- SpringBoot的坑-01
- SpringBoot的坑-03
- SpringBoot的坑-02
- 关于springboot打包的坑
- SpringBoot踩过的坑
- SpringBoot简单的SpringBoot后端
- SpringBoot-01SpringBoot配置FastJson
- Springboot 配置shiro 遇到的坑,记录
- springboot使用websocket遇到的坑
- 关于SpringBoot部署上的一些坑
- 邮件服务器&springboot---自动化的那些坑
- Springboot 集成阿里短信 ClassNotFound的坑
- springboot中关于JPA的坑
- springBoot集成shiro+redis遇到的坑
- springboot+dubbo配置走过的坑
- SpringBoot使用Thymeleaf所爬过的坑
- 关于SpringBoot的学习整理[01]
- 01-SpringBoot的三种启动方式
- c# get set使用心得
- 根文件系统树的制作及详解
- ios即时通讯客户端开发之-mac上搭建openfire服务器
- 二进制及java反射机制(培训笔记)
- mybatis generator eclipse插件的安装
- SpringBoot的坑-01
- Python图表绘制:matplotlib绘图库入门
- Python多线程简易理解
- SpringMVC中的RequestMapping修饰类注解
- Ajax学习笔记
- 微信支付
- 大数据的核心价值主要体现在哪里
- 自然语言处理入门(5)——基于WordArt的AGM手机评论词频分析
- 认清自己,改变自己