Sharing beans from contextListener -- dispatcher servlet
- by Ernest
Hello! ok, i have another question now. I have a bunch of beans loaded succesfully in applicationContext.xml, which loads from web.xml:
contextConfigLocation
applicationContext.xml
org.springframework.web.context.ContextLoaderListener
Here are is the bean defined in applicationContext.xml that i want to share:
it loads other beans (DAOs) which are initialized with hibernet.
I need to acces catalogFacadeTarget from the dispatcherServlet, declared in web.xml:
dispatcher
org.springframework.web.servlet.DispatcherServlet
1
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
and configured dispatcher-servlet.xml like this:
welcome
There! in the property called catalogFacadeImpl.
If you need the entire applicationCOntext.xml, web.xml, and dispatcher-servlet.xml please let me know.
From what i read, i should be able to share beans if i declared them in the contextConfigLocation configuration file.
Thank you very much in advance.