Springboot 在Filter 中通过@Autowired注入Bean,打包war部署为空值解决
ServletContext context = request.getServletContext(); ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context); DbUtilTpl dbUtilTpl = ctx.getBean(DbUtilTpl.class);
ServletContext context = request.getServletContext(); ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context); DbUtilTpl dbUtilTpl = ctx.getBean(DbUtilTpl.class);