|
From: Colin S. <col...@ex...> - 2005-04-02 03:36:45
|
Tim Kettering wrote: > Hi everyone, > > I’m writing this in the hopes I can get some insight on how to > approach this. In the application we are developing, we have > determined that it is necessary to start up the spring context using a > singleton, to make it available to services that sit outside the web > application. So we are using the singleton class/approach that is > recommended by the Spring developers for this purpose. > > The issue I am facing now is that we are also making use of Acegi > Security, which relies on the use of a context loader listener (which > accepts a array of strings as parameters), to start up the filter > chain proxy in web.xml. > > Since for purposes of keeping duplication to a minimum, we’d obviously > want that the filter chain proxy access the context provided by the > singleton, instead of the context listener. So I’m wondering about the > best approach for this. I’m thinking either by modifying the > ContextLoaderListener to use the singleton instead, or modifying > things on the Acegi side. > > But I thought before I got too into hacking stuff, I would ask the > list in case there are any glaringly obvious (and simple) solutions to > this issue I am looking at that would save me the need to hack a > solution. > Tim, (First of all, please make any replies to the user list, this email is better suited for that). Unless I'm missing something, this is actually trivial to handle. The ContextLoader, since Spring 1.1.5 or 1.1.4, has been automatically able to load a parent context for the main web-app context, using the ContextSingletonBeanFactoryLocator to load that parent context. You're not outright saying that you're using ContextSingletonBeanFactoryLocator, but that's what you're implying. Take a look at this web.xml file for an example of how to configure this: http://cvs.sourceforge.net/viewcvs.py/springframework/spring/autobuilds/apps/integration/src/webapp/WEB-INF/web.xml?rev=1.2&view=markup Regards, -- Colin Sampaleanu Interface21 Principal Consultant Spring Training, Consulting and Support - "From the Source" http://www.springframework.com |