cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'.

来源:互联网 发布:淘宝助理菜鸟组件 编辑:程序博客网 时间:2024/05/24 06:39

在用struts1.3的时候,写web.xml用<init-param>标签的时候,始终没法识别这个标签。报一个错误

解决:<?xml version="1.0" encoding="UTF-8"?>   
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance  http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd"    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee    
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd        
     ">  
</web-app>  
这样写,就可以了。据说要按照DTD给出的顺序严格书写,不能瞎写,不然就出错。也有人说2.4的顺序不是那么重要,给大家做个参考。




0 0