In my application I have placed the ApplicationContext xml file in src and the project is working fine.
Can we place the ApplicationContext.xml in
Yes you can.
If you put the files directly inside WEB-INF that should work.
If you want to put them in a folder called WEB-INF/conf you would need to change the properties location to refer to conf/LicenseSettings.properties
There are couple of ways you can do this:
In Spring MVC, You mention dispatcher-servlet in web.xml as follows
<servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet>
Now this by default will look for a file named mvc-dispatcher-servlet.xml. That is, the servlet name appended by -servlet.xml. And it will look for this file in class path.
Alternatively which fits your case, if you already have xml file and don't want to rename it, add the following entry in web.xml in addition to the servlet entry above.
<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/conf/ApplicationContext.xml</param-value> </context-param
Here you can choose any location inside WEB-INF. Put the properties file in classes folder so that it could be found in classpath. Since you are using Eclipse embedded Tomcat, put the following as your bean configuration for property placeholder.
<property name="location" value="classpath:../../conf/LicenseSettings.properties" />