Feb 12th, 2007, 01:25 AM
configure applicationContext for servlets?
i would like to configure tomcat servlet with applicationContext, i don't want to use webflow, or mvc, i just wanna wire beans simplest (and fastest way), i thought about using ClassPathApplicationContext, but i was wondering if i can use the WebApplicationContext for this as well.
(using spring 1.2.8).
Feb 12th, 2007, 01:43 AM
Just use the ContextLoaderListener to load the ApplicationContext. It will be registered in the ServletContext under a specified name (WebApplicationContext.ROOT_WEB_APPLICATION_CONTEX T_ATTRIBUTE) for the actual value check the source of the ContextLoaderListener and related classes.
Of course you can always create your own loader which uses the ClassPathXmlApplicationContext.