【发布时间】:2015-02-18 08:19:20
【问题描述】:
我正在使用 Struts 2。
localhost:8084/Web/viewProductsAction?idProducts=1
看到这个产品后,我发表评论
它成功了,但我被感动了
localhost:8084/Web/listProductsAction
这是struts.xml中的代码:
<action name="listProductsAction" class="com.struts2.action.ProductsAction" method="viewProducts">
<result name="success">/products.jsp</result>
</action>
<action name="sendComments" class="com.struts2.action.CommentsAction" method="sendComments">
<result name="success" type="redirect">listProductsAction</result>
</action>
但我想在发表评论后转发给
localhost:8084/Web/viewProductsAction?idProducts=1
我该怎么做?
【问题讨论】:
-
上述网址的动作配置是什么?
-
你的意思是 web.xml 文件?
-
您仅在 xml 中发布了两个操作
listProductsAction和sendComments的操作配置。localhost:8084/Web/viewProductsAction?idProducts=1的动作配置是什么? -
/products.jsp 行动>
标签: java redirect struts2 actionresult