如何使用参数重定向动作作为Struts中的帖子?

Nin*_*jin 5 parameters post struts2

将操作重定向到另一个操作struts.xml:

<action name="CheckLogin" class="LoginS" method="checkLogin">
    <result name="input" type="redirectAction">
        <param name="actionName">SectorDisplay</param>
        <param name="branch_id">${branch_id}</param>
    </result>
</action>
Run Code Online (Sandbox Code Playgroud)

参数虽然发送,branch_idurl它显示为

http://localhost:8085/Display/SectorDisplay.action?branch_id=110
Run Code Online (Sandbox Code Playgroud)

我认为它不是POST,它的GET.

我不想在URL上显示参数,是否有任何方法可以隐藏它或如何将其发布到操作中?

谢谢..

Cha*_*nya 4

通过重定向,您只能传递GET参数。您可以使用动作链作为替代方案。

查看这些帖子了解详细信息:

您可以使用 POST 而不是 GET 进行 struts2 操作重定向吗?

Struts 1 使用 POST 请求参数从一个操作重定向到另一个操作