2
我試圖從Struts 2.3遷移到2.5.2,但我有兩個奇怪的問題。它們在2.3中很好,所以也許問題是關於Convention插件。將Struts 2.3遷移到2.5的問題
假設我有兩個動作:
mypackage.actions.LimitAction
mypackage.actions.user.UserAction
在2.3:
http://myurl/limit.action -> OK
http://myurl/anything/limit.action -> There is no Action ... which is OK
http://myurl/user/user.action -> OK
在2.5:
http://myurl/anything/limit.action -> OK ... which should be There is no Action ...
如果我在struts.xml的默認操作設置:
<default-action-ref name="other" />
<action name="other" class="mypackage.actions.OtherAction">
<result />
</action>
然後
http://myurl/limit.action -> went wrong and OtherAction is shown
看來,如果我有默認操作,然後在主包(mypackage.actions)的每一個動作由OtherAction隱藏,但
http://myurl/anything/limit.action -> still works which is wrong too
它是在Struts中2.5的bug。 2? 如何設置默認動作而不使主包中的動作出錯? 如何解決無法訪問主包操作與anyurl/*動作