contextConfigLocation
/WEB-INF/classes/spring/applicationContext-*.xml
这个contextConfigLocation名字是规定好吗,可以自己随便取值吗
[b]那个参数是在ContextLoader中定义的:[/b]
[code="java"]public class ContextLoader {
public static final String CONFIG_LOCATION_PARAM = "contextConfigLocation";[/code]
[color=blue][b]是Spring的listener在启动的时候,要在Application或者成为ServletContext中,寻找名为:contextConfigLocation的参数。
所以这个参数在使用Spring的时候,不能改变。[/b][/color]
对的。
在ContextLoaderListener 中利用到了ContextLoader的initWebApplicationContext方法,在该方法的后续方法利用到那个参数了。不太好找,包装的太严了。呵呵