Error while splitting application context file in spring
- by Krupal
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 !