为org.springframework.web.servlet.DispatcherServlet设置参数contextConfigLocation自定义spring配置文件的位置,设置完后如下: [xml] spring org.springframework.web.servlet.DispatcherServlet 1 contextConfigLocation /WEB-INF/spring-servlet.xml
[/xml]
直接部署运行没有问题,但是用eclipse打开就在第5行处报错:
1 2 3 4 5
Description Resource Path Location Type cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of'{"http://java.sun.com/xml/ns/javaee":enabled, "http://java.sun.com/xml/ns/javaee":async-supported, "http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/javaee":security-role-ref, "http://java.sun.com/xml/ns/javaee":multipart-config}' is expected.
将配置文件改为: [xml] spring org.springframework.web.servlet.DispatcherServlet contextConfigLocation /WEB-INF/spring-servlet.xml