私は春のMVCのデフォルトの設定に従って、それはWEB-INFから直接ディスパッチャ・サーブレットファイルを選ぶと考えています。ただし、カスタムの場所を指定する場合は、web.xmlのdispatcherServletに<init-param>
を入力し、xmlファイルのカスタムの場所を指定できます。 例
<servlet>
<servlet-name>SpringDispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/applicationContext-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
もう一つの方法は、web.xmlに春ContextLoaderListnerを使用することで、<context-param>
例:としてxmlファイルを与えます。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>