Error while splitting application context file in spring

Posted by Krupal on Stack Overflow See other posts from Stack Overflow or by Krupal
Published on 2009-02-24T11:11:36Z Indexed on 2010/03/17 2:31 UTC
Read the original article Hit count: 359

I am trying to split the ApplicationContext file in Spring.

For ex. the file is testproject-servlet.xml having all the entries. Now I want to split this single file into multiple files according to logical groups like : group1-services.xml, group2-services.xml

I have created following entries in web.xml :

<servlet>
    <servlet-name>testproject</servlet-name>
    <servlet-class>
    	org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <init-param>
    	<param-name>contextConfigLocation</param-name>
    	<param-value>
    		/WEB-INF/group1-services.xml, /WEB-INF/group2-services.xml
    	</param-value>
    </init-param>		
         <load-on-startup>1</load-on-startup>
</servlet>

I am using SimpleUrlHandlerMapping as:

RegisterController PayrollServicesController

I also have the controller defined as :

.. ..

The problem is that I have splitted the ApplicationContext file "testproject-servlet.xml" into two different files and I have kept the above entries in "group1-services.xml". Is it fine? I want to group things logically based on their use in seperate .xml files.

But I am getting the following error when I try to access a page inside the application :

org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping for [/TestProject/payroll_services.htm] in DispatcherServlet with name 'testproject'

Please tell me how to resolve it.

Thanks in Advance !

© Stack Overflow or respective owner

Related posts about spring-mvc

Related posts about spring-framework