I have aded following code to my web.xml
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:com/neelamhotel/mavenwebproject5/configs/dao-context.xml
</param-value>
But I am getting error for the same as
IOException parsing XML document from class path resource [com/neelamhotel/mavenwebproject5/configs/dao-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [com/neelamhotel/mavenwebproject5/configs/dao-context.xml] cannot be opened because it does not exist
Project Structure
Explorer View
I know dao-context.xml
file is there. But then why it is giving an error ?
Updated Explorer view
Created WAR file view
classpath:/com/neelamhotel/mavenwebproject5/configs/dao-configs.xml
(and try again). Without that, the location is relative to the path from where you're opening the application. – Augustoclasspath
when passingparam-value
. – Meena Chaudhary