File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Sharing bean(s) between applicationContext-security.xml and dispatcher-servlet.xml **SOLVED** Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Sharing bean(s) between applicationContext-security.xml and dispatcher-servlet.xml **SOLVED**" Watch "Sharing bean(s) between applicationContext-security.xml and dispatcher-servlet.xml **SOLVED**" New topic
Author

Sharing bean(s) between applicationContext-security.xml and dispatcher-servlet.xml **SOLVED**

Edward Winchester
Ranch Hand

Joined: Sep 16, 2009
Posts: 65
EDIT: This is solved but any other ideas are more than welcome

Hello,

I'm incorporating Spring Security into my application. My web.xml contains another contextConfigLocation called /WEB-INF/applicationContext-security.xml.

I have an existing xml configuration for my dispatcher servlet: dispatcher-servlet.xml. This includes configuration for a few DAO service beans.

The "issue" is that some beans defined in the security configuration need to be injected with DAO/service beans.

This is where my knowledge of these bean containers and contexts gets sketchy so I ask what is the best way to do this?

Thanks,

Ed

N.B. Also posted at springsource.org but didn't get a reply.
Edward Winchester
Ranch Hand

Joined: Sep 16, 2009
Posts: 65
Have discovered the import tag:



Even though I will have two instances of the common beans, this fits my requirements (for now!).

Thanks,

Ed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sharing bean(s) between applicationContext-security.xml and dispatcher-servlet.xml **SOLVED**