zoukankan      html  css  js  c++  java
  • The content of element type "strutsconfig" must match "(displayname?,descr

    配置struts-config.xml 时,出了异常信息:

    The content of element type "struts-config" must match "(display-name?,description?,form-beans?,global-exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*)". 
    

    解决办法:
    struts-config.xml 中的元素顺序有严格的要求,它们的位置不能错位,不然就会报错.

    <?xml version="1.0" encoding="UTF-8"?>  
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd">  
    <struts-config>  
            <form-beans>  
            </form-beans>  
      
            <global-exceptions>  
            </global-exceptions>  
      
            <global-forwards>  
            </global-forwards>  
      
            <action-mappings>  
                <action path="/index" type="org.apache.struts.actions.ForwardAction" parameter="index-tiles"></action>  
            </action-mappings>  
      
            <controller>  
                <set-property property="processorClass" value="org.apache.struts.tiles.TilesRequestProcessor"/>  
            </controller>  
      
            <message-resources parameter="com.test.struts.ApplicationResources" />  
      
            <plug-in className="org.apache.struts.tiles.TilesPlugin">  
                <set-property value="/WEB-INF/tiles/tiles-defs.xml" property="definitions-config"></set-property>  
            </plug-in>  
    </struts-config>  

    注意: 
    struts-config.xml必须按照 display-name --> description --> form-beans --> global-exceptions --> global-forwards --> action-mappings --> controller --> message-resources --> plug-in 的顺序书写 .

  • 相关阅读:
    数据库——大事务
    数据库——性能理解
    java——通过GenericObjectPool获取到的资源,调用close()方法会close还是returnObject?
    gradle——入门
    MongoDB——morphia
    jvm——Java main方法的执行
    sql——limit
    阿里云Open API自动化脚本—ECS公网IP转化弹性公网IP
    阿里云共享带宽
    mysql5.x安装脚本
  • 原文地址:https://www.cnblogs.com/dafa/p/2770910.html
Copyright © 2011-2022 走看看