struts2 配置文件报错

来源:互联网 发布:美拍的网络不稳定 编辑:程序博客网 时间:2024/05/16 19:48
struts2的配置文件 struts.xml 是有顺序的, 我将我写的
default-interceptor-ref放在了interceptors的前面, 就报了这样的错误.
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*)". ”
错误 的意思就是说, struts的package必须包括括号中的元素, 但没有提到顺序问题.  反复测试才发现一定要按照其顺序进行, 调整顺序之后一切就OK了.
result-types
interceptors
default-interceptor-ref
default-action-ref
default-class-ref
global-results
global-exception-mappings
action*(就是所有的action放到最后)