【发布时间】:2013-07-26 01:02:34
【问题描述】:
我需要将一个动作的参数传递给另一个动作,但它遇到了以下错误。
Messages:
There is no Action mapped for namespace [/Product/Product] and action name [desc] associated with context path [].
struts.xml
<package name="MyProducts" extends="default" namespace="/Product/Find">
<result name="Desc" type="redirectAction">
<param name="actionName">../Product/desc</param>
<param name="id">${id}</param>
</result>
....
<package name="Product" extends="default" namespace="/Product">
..........
在第一个操作中(在命名空间/Product/Find 中),我正在设置具有 getter 和 setter 的 id。
在第二个操作中(在命名空间 /Product 中)我有一个 id 变量以及 getter 和 setter。
【问题讨论】:
-
看起来空指针可能与映射有关。您能否仅使用浏览器中的地址栏直接重定向到的操作并确认您是否继续获取空指针?
-
@MichaelFreake 我忘记包含其中一个 gettes 但现在出现了映射问题
标签: java struts2 action-mapping