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

今天在对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放到最后)

原来我把default-action-ref放在了其他的节点之后了,调整位置之后,错误消失了

猜你喜欢

转载自330967688-qq-com.iteye.com/blog/1528837