Look ate Spring MVC (chapter 3.8.5 in particular). All you need is to integrate your Application Context with your Application container via web.xml and use ContextLoader to bootstrap your application context as shown below.
Code:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/your-config.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
Then if you want to access it within your environment, Spring provides a convenience API
Code:
. . . . . . .
ApplicationContext context = WebApplicationContextUtils.
getRequiredWebApplicationContext(getServletContext());
YourBean bean = (YourBean)context.getBean("yourBean");
. . . . . . .