2

Struts 2.3 から 2.5.2 に移行しようとしていますが、奇妙な問題が 2 つあります。それらは 2.3 で良かったので、おそらく問題はコンベンション プラグインに関するものです。

2 つのアクションがあるとします。

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.2 のバグですか? メインパッケージのアクションを間違えずにデフォルトのアクションを設定するにはどうすればよいですか? anyurl/*.action を使用してメイン パッケージのアクションにアクセスしないように修正するにはどうすればよいですか

4

1 に答える 1