Announcement Announcement Module
Collapse
No announcement yet.
ContextLoaderListener question! Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ContextLoaderListener question!

    hi,

    I am a complete newbie to Spring. And today is my first attempt to use it. I am heavily using Struts till now. I have question regarding configuration in Spring based web-apps.

    I see that ContextLoaderListener use is emphasised all over (for Spring) and there is a possibility to do it in web.xml

    What with the following scenario:

    1) I have an exploded (not war) application deployed, say at C:\webapps\exampleApp

    2) The context configuration file is deployed on tomcat\conf\Catalina\localhost\exampleApp1.xml

    3) Another context configuration file is deployed on tomcat\conf\Catalina\localhost\exampleApp2.xml using the same source

    Now if i m gonna use the ContextLoaderListner, i wish to provide applicationContext.xml either for application or for jdbc or any other config for different contexts setups (exampleApp1, exampleApp2).

    But as far as i see, the applicationContext.xml should always be inside the WEB-INF\ folder. But this will lead me to make use of seperate sources for different contexts. Why?

    Can't i define the applicationContext or the log4j configuration files out of the sources???

    At the moment, i m using the InitialisationServlet with my existing struts application to pick the resources from defined locations at the tomcat-context xml file. How can i substitute the same behaviour with ContextLoaderListener?

    Thanks for your feedback.

    Regards,
    pats

  • #2
    Re: ContextLoaderListener question!

    Originally posted by pats143
    But as far as i see, the applicationContext.xml should always be inside the WEB-INF\ folder. But this will lead me to make use of seperate sources for different contexts. Why?
    The locations of context files can be defined in web.xml as context parameters.

    Comment


    • #3
      I don't want to bundle the location into web.xml but on context file for the tomcat deployment. Because that makes my application more flexible.

      Is ContextLoaderListener listens to the context file placed in tomcat??

      I am fairly new with Spring, my questions may sound weird.

      Please give ur suggestion.
      thanks
      aks

      Comment

      Working...
      X