• The content of element type "strutsconfig" must match "(displayname?,descripti .


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

     

    Java代码  收藏代码
    1. 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 中的元素顺序有严格的要求,它们的位置不能错位,不然就会报错.

     

     

    正确的顺序,参考代码: 

    Java代码  收藏代码
    1. <?xml version="1.0" encoding="UTF-8"?>  
    2. <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd">  
    3. <struts-config>  
    4.         <form-beans>  
    5.         </form-beans>  
    6.   
    7.         <global-exceptions>  
    8.         </global-exceptions>  
    9.   
    10.         <global-forwards>  
    11.         </global-forwards>  
    12.   
    13.         <action-mappings>  
    14.             <action path="/index" type="org.apache.struts.actions.ForwardAction" parameter="index-tiles"></action>  
    15.         </action-mappings>  
    16.   
    17.         <controller>  
    18.             <set-property property="processorClass" value="org.apache.struts.tiles.TilesRequestProcessor"/>  
    19.         </controller>  
    20.   
    21.         <message-resources parameter="com.test.struts.ApplicationResources" />  
    22.   
    23.         <plug-in className="org.apache.struts.tiles.TilesPlugin">  
    24.             <set-property value="/WEB-INF/tiles/tiles-defs.xml" property="definitions-config"></set-property>  
    25.         </plug-in>  
    26. </struts-config>  
  • 相关阅读:
    RecyclerView-------MainActivity代码
    ListView控件
    Java 内部类的阐述
    JAVA匿名内部类
    Process.Start(@"C:WindowsSystem32osk.exe") 找不到指定文件
    The program can't start because AppVIsvSubsystems64.dll is missing from your computer
    Rclone webapi 使用例子
    C# lock 死锁问题排查方法
    zeroc ICE 使用案例
    log4net 纯代码配置
  • 原文地址:https://www.cnblogs.com/a1280055207/p/3116833.html
Copyright © 2020-2023  润新知