PDA

View Full Version : DispatchServlet and multiple xml configuration files



templth
Aug 25th, 2004, 01:55 PM
Hello,

I want to Spring MVC and other layers ( services, dao ). How can I separate configurations of presentation elements, business services element and dao/persistence elements into several xml configuration files? and how can I configure the DispatchServlet to use these xml files?
Thanks for your help,
Thierry

Alef Arendsen
Aug 25th, 2004, 02:08 PM
In your web.xml you will have to specify a location for the contexts you're using (except for the XXX-servlet.xml, which will contain your web-related beans). Also, you'll have to add a ContextLoaderListener or ContextLoaderServlet. Using the two you can spread your beans across as many files as you like :D.

Have a look at section 3.15 (Creating an ApplicationContext...) of the reference manual, you will find more info there.

Alef

templth
Aug 28th, 2004, 04:53 AM
Thanks a lot for help :D
Thierry