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

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

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

2.
ServletContext servletContext = this.getServletContext();  
WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(servletContext);
posted @ 2021-07-01 09:24  君子笑而不语  阅读(120)  评论(0)    收藏  举报