Results 1 to 2 of 2

Thread: Custom config files...

  1. #1

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Norwalk, CT USA
    Posts
    27

    Default

    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>
    Ritesh

Posting Permissions

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