【问题标题】:How to redirect action with parameter as post in Struts?如何在 Struts 中使用参数重定向动作作为帖子?
【发布时间】:2015-04-02 04:17:40
【问题描述】:

将动作重定向到另一个动作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>

参数以branch_id 发送,但它在url 上,它显示为

http://localhost:8085/Display/SectorDisplay.action?branch_id=110

我认为它不是 POST,而是 GET。

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

谢谢你..

【问题讨论】:

标签: post parameters struts2


【解决方案1】:

使用重定向只能传递GET 参数。您可以使用action chaining 作为替代。

查看这些帖子了解详情:

Can you do a struts2 action redirect using POST instead of GET?

Struts 1 redirect from action to action with parameters as POST request

【讨论】:

    猜你喜欢
    • 2016-05-31
    • 1970-01-01
    • 1970-01-01
    • 2015-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多