struts2配置文件错误(The content of element type “package” must match**)

来源:互联网 发布:python nltk 编辑:程序博客网 时间:2024/06/10 14:41
今天在对struts2的做一些缺省配置,当想增加一个缺省的action时,出现了错误 


错误提示是: 

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*)”. 

个人理解,字面意思应该是可能某个节点写错了,但是仔细对照了一下没有发现配置文件中有对不上号的节点啊,于是上网搜索了一下 

原来是需要是需要按照一定的顺序排列的,按照错误提示就是: 

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