spring-mvc configuration

note to myself…..
Lately I was trying to find out how to configure spring’s DispatcherServlet in order to use multiple config files. don’t remember where but I happened to come across with an answer that there is no way to do that. this is completely wrong , at least for spring 2.5 release. Besides, it is very easy… mmmm so I should immediately keep a record of thissss.

in web.xml file

<servlet>
 <servlet-name>myApp</servlet-name>
 <servlet-class>org.springframework.web.servlet.DispatcherServlet
 </servlet-class>
 <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:dbase.xml,classpath:controller.xml</param-value>
 </init-param>
 <load-on-startup>1</load-on-startup>
</servlet>
Advertisement

1 Comment »

  1. Adam said

    Hi, Thank you for writing it down, you made my day.
    I was sure it can be done somehow, but I forgot that the servlet object params have to be encapsulated in the section.

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.