suki3100 2012-04-05 19:02
浏览 328
已采纳

配置Spring mvc 注解配置的时候 静态页面跳转 报的错

相应的包 都加了, 就是报错,

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 16 in XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:default-servlet-handler'.

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:default-servlet-handler'.

  • 写回答

1条回答 默认 最新

  • jep1983 2012-04-08 17:26
    关注

    mvc:default-servlet-handler/这个标签是在spring3.0.4发布之后才有的,现在如果用这个标签,因为spring官方的http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 还没有更新。所以会报错,有以下方法可以代替:
    手动将3.0.4版本中的spring-mvc-3.0.xsd添加到本地的xml catalog 中,xsd所在位置:
    org.springframework.web.servlet-3.0.4.RELEASE.jar\org\springframework\web\servlet\config。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?