Announcement Announcement Module
Collapse
No announcement yet.
Mutiple context files - ContextLoaderListener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mutiple context files - ContextLoaderListener

    The applicationContext.xml config file for our wep is getting quite large and has some logical groupings. We are currently using the org.springframework.web.context.ContextLoaderListe ner to configure our application. As far as I can tell you can't have more than one config file using the ContextLoaderListener? I was reading more about the XmlWebApplicationContext and that it had support for multiple config files. Do you have to load the XmlWebApplicationContext using a ContextLoaderServlet in order to have more than one config file?

    Thx,

    Bryan

  • #2
    org.springframework.web.context.ContextLoaderListe ner does support multiple XML config files.

    Code:
      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
           /WEB-INF/applicationContext1.xml
           /WEB-INF/applicationContext2.xml
           /WEB-INF/applicationContext3.xml
        </param-value>
       </context-param>
    
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
    HTH

    Comment


    • #3
      WORKS!

      Thank you Omar for the quick reply. That works perfect.

      Comment

      Working...
      X