I have a class which implements ContainerRequestFilter, i want to inject some spring dependencies into it so i need to make Spring aware of the Jersey filter. The filter itself is configured in my web.xml with the Jersey servlet
<servlet>
<servlet-name>Jersey Spring Web Application</servlet-name>
<servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.MyFilter</param-value>
</init-param>
</servlet>
The filter class then attempts to inject the Manager bean. In order to make spring aware of the Filter bean i have defined the bean in my applicationContext.xml and included.
@Component
public class MyFilter implements ContainerRequestFilter {
@Autowired
private Manager manager;
I've attempted to make the filter bean visible by forcing Spring to use proxy generated classes however this is not working
<mvc:annotation-driven />
<aop:aspect-autoproxy />
<bean id="filter" class="com.MyFilter">
<property name="manager" ref="Manager" />
</bean>
Any suggestions on how i can edit existing code to allow the filter see spring beans?