Open sunxboy opened 7 years ago
@Priority(900)
@PreMatching
@Provider
public class AuthenticationTraceFilter implements ContainerRequestFilter, ContainerResponseFilter {
@Context
private HttpServletRequest httpRequest;
@Autowired
private MyService service;
...........
}
static { userService = BeanContext.getBean(UserService.class); applicationDao = BeanContext.getBean(ApplicationDao.class); }
public class BeanContext implements ApplicationContextAware
如上配置,添加了一个扩展,AuthenticationTraceFilter 分别实现了ContainerRequestFilter,ContainerResponseFilter接口。 我想在AuthenticationTraceFilter引入spring中的其它对象,怎么做?@Autowired注解试过了,不行。