...... FilterThatNeedsBean ...... FilterThatNeedsBean ...... FilterThatNeedsBean

How to make sure spring beans gets initialized before web.xml filters gets initialized in spring mvc world?

25 Views Asked by At

I have a web.xml


<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="3.0"
>

......

    <filter>
        <filter-name>FilterThatNeedsBean</filter-name>
        <filter-class>com.abc.FilterThanNeedsBean</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>FilterThatNeedsBean</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

.....

</web-app>

I have spring-beans.xml

    <bean id="BeanA" class="com.cde.BeanA">
    </bean>

Getting error in init method of 'FilterThatNeedsBean' filter as 'BeanA' is not yet initialized for usage

How to make sure spring beans gets initialized before web.xml filters gets initialized in spring mvc world ?

0

There are 0 best solutions below