Results 1 to 2 of 2

Thread: configure applicationContext for servlets?

  1. #1
    Join Date
    Jul 2006
    Posts
    154

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •