-
Sep 3rd, 2008, 02:16 PM
#1
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.
-
Sep 3rd, 2008, 03:11 PM
#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>
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
-
Forum Rules