其他分享
首页 > 其他分享> > spring在filter类里注解bean的几个写法

spring在filter类里注解bean的几个写法

作者:互联网

spring在filter类里注解bean的几个写法:

1. SpringContextHolder.getApplicationContext().getBean(RedisSimpleClient.class);

2.
ServletContext servletContext = this.getServletContext();  
WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(servletContext);

标签:spring,filter,bean,servletContext,注解,类里
来源: https://www.cnblogs.com/xiaoliu66007/p/14957335.html