I am using spring mvc and spring security. In my security-app-context.xml I have:
<authentication-manager>
<authentication-provider user-service-ref="MyUserDetailsService"/>
</authentication-manager>
And therefore I need to configure MyUserDetailsService in this security-app-context.xml file. So I added:
<beans:bean id="MyUserDetailsService"
class="my.web.authentication.GreenWheelsUserDetailsService">
<beans:property name="transactionManager" ref="transactionManager"/>
<beans:property name="userDao" ref="userDao"/>
</beans:bean>
But this cause me to add transactionManager and userDao beans to this file too! So I added:
<beans:bean id="transactionManager" class="my.dataAccess.hibernate.HibernateTransactionManager"/>
<beans:bean id="userDao" class="my.dataAccess.hibernate.HibernateUserDao"/>
But now I want to add anothr beans for other DAOs. I prefer to put all my beans in different file then the security-app-context.xml file. How do I do that and keep the authentication-manager section correct?
You can use import: