Results 1 to 3 of 3

Thread: Using DelegatingFilterProxy with autowired dependency

Threaded View

  1. #1
    Join Date
    May 2011
    Posts
    4

    Question Using DelegatingFilterProxy with autowired dependency

    Hi,

    I have a filter defined in web.xml as
    Code:
    <filter>
            <filter-name>sampleSpringFilter</filter-name>
            <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        </filter>
        
        <filter-mapping>
    		<filter-name>sampleSpringFilter</filter-name>
    		<url-pattern>/api/foo/*</url-pattern>
        </filter-mapping>
    The class sampleSpringFilter is defined as:
    Code:
    @Component("sampleSpringFilter")
    public class SampleSpringFilter implementes Filter
    {
    
      @Inject
      private ITestService testService;
    
     @Override
    	public void doFilter(ServletRequest request, ServletResponse response,
    			FilterChain chain) throws IOException, ServletException {
    --
    }
    }
    When I am trying to deploy my webapp in tomcat 7, application context is not able to find sampleSpringFilter.
    I don't want to use xml based bean definition for sampleSpringFilter.

    Please help me resolving this issue.
    Last edited by omanand; Oct 25th, 2012 at 12:29 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •