struts-config配置顺序不对,报错
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 时,报出了上面的异常信息。
解决办法:
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 的顺序书写 .
转自CSDN,网址为:
http://blog. csdn.net/yunxihanherui/article/details/7486132
相关推荐
Kafka 2020-09-18
Wepe0 2020-10-30
杜倩 2020-10-29
windle 2020-10-29
minerd 2020-10-28
mengzuchao 2020-10-22
Junzizhiai 2020-10-10
bxqybxqy 2020-09-30
风之沙城 2020-09-24
kingszelda 2020-09-22
大唐帝国前营 2020-08-18
yixu0 2020-08-17
TangCuYu 2020-08-15
xiaoboliu00 2020-08-15
songshijiazuaa 2020-08-15
xclxcl 2020-08-03
zmzmmf 2020-08-03
newfarhui 2020-08-03
likesyour 2020-08-01