Spring, Need to use a a bean declared in a ApplicationContextFactory servlet, in a DispatcherServlet

Posted by Ernest on Stack Overflow See other posts from Stack Overflow or by Ernest
Published on 2010-06-07T23:53:39Z Indexed on 2010/06/08 5:52 UTC
Read the original article Hit count: 264

Filed under:

Hello, i have a web.xml with these 2 servlet:

<servlet>
        <servlet-name>ApplicationContextFactory</servlet-name>
        <servlet-class>com.bamboo.common.factory.ApplicationContextFactory</servlet-class>
        <load-on-startup>1</load-on-startup>
</servlet>

AND

<servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
</servlet>

I need to use these bean declared on the ApplicationContextFactory:

 <bean id="**catalogFacadeTarget**" class="com.bamboo.catW3.business.impl.CatalogFacadeImpl">
        <property name="categoryDAO"><ref local="categoryDAOTarget"/></property>
        <property name="containerDAO"><ref local="containerDAOTarget"/></property>
        <property name="productDAO"><ref local="productDAOTarget"/></property>
        <property name="productOptionDAO"><ref local="productOptionDAOTarget"/></property>
        <property name="productStatusDAO"><ref local="productStatusDAOTarget"/></property>
        <property name="userDAO"><ref local="userDAOTarget"/></property>
</bean>

in the dispatcher-servlet like this:

<bean name="welcome"
    class="com.bamboo.catW3.business.impl.Welcome">
    <property name="successView">
        <value>welcome</value>
    </property>
     <property name="catalogFacadeImpl"><ref   local="**categoryDAOTarget**"/> </property>
</bean>

Is it posible some how? Thank you!

© Stack Overflow or respective owner

Related posts about spring