配置web.xml中的 Invalid content was found starting with element ‘init-param’.错误

  • Post author:
  • Post category:其他


今天在搭建springmvc框架时,需要配置web.xml中的

DispatcherServlet

初始化代码如下

<servlet>
      <servlet-name>chapter</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      <init-param>
         <param-name>contextConfigLocation</param-name>
         <param-value>/WEB-INF/config/spring/chapter-servlet.xml</param-value>
      </init-param>
  </servlet>
  <servlet-mapping>
      <servlet-name>chapter</servlet-name>
      <url-pattern>/</url-pattern>
  </servlet-mapping>

其中的

<init-param>
         <param-name>contextConfigLocation</param-name>
         <param-value>/WEB-INF/config/spring/chapter-servlet.xml&l



版权声明:本文为JavaLixy原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。