Struts2 的配置文件 struts.xml 中package元素内部的内容及顺序是有一定要求的,具体如下:
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*)"
可见,如果放置 default-action-ref 元素也是有顺序要求的,即放在所有 action 之前, default-action-ref 的功能是设置默认的action,当访问一个不存在的action时就用默认的action处理。
更多参见: http://woshixushigang.iteye.com/blog/1155194