I have created a spring MVC application. I'm working on spring security concepts. So I've created a context configuration file name webbsite-security.xml and I've given the same file location in the context configuration path. The application fails due to an exception stating that FILENOTFOUNDEXCEPTION(applicationContext.xml not found). Is it necessary that a file named applicationContext.xml should exits even though we use some other configuration files.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Why would you want to call it anything else, it would go against the default standard spring way fo doing things. Just import the relevant config files into the default app context xml.
But if you want change it you must specifiy in your web.xml the following :
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/whatevever.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>