Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将Struts 2.3迁移到2.5中的问题_Java_Http_Configuration_Struts2_Struts Action - Fatal编程技术网

Java 将Struts 2.3迁移到2.5中的问题

Java 将Struts 2.3迁移到2.5中的问题,java,http,configuration,struts2,struts-action,Java,Http,Configuration,Struts2,Struts Action,我正在尝试从Struts 2.3迁移到2.5.2,但我有两个奇怪的问题。他们在2.3中表现不错,所以问题可能在于常规插件 让我们假设我有两个动作: mypackage.actions.LimitAction mypackage.actions.user.UserAction 在第2.3条中: http://myurl/limit.action -> OK http://myurl/anything/limit.action -> There is no Actio

我正在尝试从Struts 2.3迁移到2.5.2,但我有两个奇怪的问题。他们在2.3中表现不错,所以问题可能在于常规插件

让我们假设我有两个动作:

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中设置了默认操作:


然后

似乎若我有默认操作,那个么主包(mypackage.actions)中的每个操作都会被OtherAction隐藏,但

http://myurl/anything/limit.action -> still works which is wrong too
它是Struts 2.5.2中的一个bug吗? 如何设置默认操作而不使主包中的操作出错?
如何修复不使用anyurl/*访问主程序包中的操作。操作

通过在主程序包中的每个操作中设置
“/”
命名空间,这两个问题都已修复:

@Namespace("/")
当请求url为

/anything/limit.action 
Struts找不到操作,它将在默认的
命名空间中查找LimitAction

/anything/limit.action