提供ClassPathXmlApplicationContext的路径

时间:2015-05-01 17:28:11

标签: java spring

var flatten = function(){ var placeHolder = [], lastIndex = []; placeHolder.count = 0; lastIndex.count = 0; return function flatten(input) { var i, out = []; placeHolder[0] = input; placeHolder.count = 1; lastIndex[0] = -1; lastIndex.count = 1; while (placeHolder.count) { input = placeHolder[--placeHolder.count]; i = lastIndex[--lastIndex.count] + 1; for (; i < input.length; ++i) { if (Array.isArray(input[i])) { placeHolder[placeHolder.count++] = input; lastIndex[lastIndex.count++] = i; input = input[i]; i = -1; } else out.push(input[i]); } } return out; } }(); 的正确路径应该是什么? servlet-context.xml

这是属性ApplicationContext contex = new ClassPathXmlApplicationContext("???");中的路径:servlet-context.xml

enter image description here

1 个答案:

答案 0 :(得分:0)

由于您使用的是maven,您可以将此xml文件放在src/main/resources目录中并通过

引用它
ApplicationContext contex = new ClassPathXmlApplicationContext("/servlet-context.xml");