Announcement Announcement Module
Collapse
No announcement yet.
Custom config files... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom config files...

    Hi

    How can I setup and use my own config files in Spring MVC.

    Currently I have the xyx-servlet.xml config file (xyz == my application context for my webapp) this defines all teh url mapping etc, and the applicationContext.xml file that defines all my managers, dao's etc.

    How can I break this up?

    I.E. I'm using a kind of pluggable architecture and I"d like it so that Ic an tell people to just add a line in my engines-context.xml file instead of having them navitage a massive applicationContext.xml file.

    Thanks.

  • #2
    You can break configuration into as many xml files as you want and give them any name. In web.xml, you can load all files using contextConfigLocation param (Used by rg.springframework.web.context.ContextLoaderListen er). An example is:

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/config/*.xml</param-value>
    </context-param>

    ......

    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>

    Comment

    Working...
    X