Originally posted by K Kiran Kumar:
Hi,
I have fixed the issue. The only thing I have modified is the web.xml's contextConfigLocation param name. I have removed the other two xml files(/WEB-INF/login-service.xml,/WEB-INF/login-data.xml)in the param-value
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/login-servlet.xml</param-value>
</context-param>
If we don't use this param, the controller will look for applicationContext.xml under WEB-INF. So in order to load our own xml instead of the default one, we have to use the above tag.
Thanks for all who helped me in this issue.
Regards,
Kiran.
Yes, applicationContext.xml is the default name it looks for when you don't supply the contextParam in your web.xml. But if you use the default name for your application context as applicationContext, then you don't need to add more xml to your web.xml.
Same thing goes with your
servlet xml file for defining you viewResolvers and Controllers. if you call it xxx-servlet.xml where xxx is the name of the servlet that you give in web.xml for servlet name for the dispatcher servlet.
so if I have
<servlet>
<servlet-name>MyServlet</...>
<servlet-class>...DispatcherServlet</...>
</servlet>
Then you don't have to include the init param in there.
Mark