Announcement Announcement Module
Collapse
No announcement yet.
configure applicationContext for servlets? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • configure applicationContext for servlets?

    hi..

    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).

  • #2
    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.

    Comment

    Working...
    X