The content of element type "package" must match 。。。。。。

今天写东东的时候,在struts。xml中的 配置默认action的时候,总是有错,报异常如下:

Caused by: The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)". - file:/D:/Java/Apache%20Software%20Foundation/Tomcat%206.0/webapps/ejuornal/WEB-INF/classes/struts.xml:17:12
 at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:119)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1009)
 ... 22 more
Caused by: org.xml.sax.SAXParseException: The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)".
 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)

经过多方查找,才知道在package包中有 的配置标签是有顺序的:

result-types
interceptors
default-interceptor-ref
default-action-ref
default-class-ref
global-results
global-exception-mappings
action*(就是所有的action放到最后)

转载自:https://blog.csdn.net/liyunyun6/article/details/8947675

猜你喜欢

转载自blog.csdn.net/hnnydxhxg/article/details/81326999