Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect action with parameter as post in Struts?

Redirect action to another action 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>

parametes is sent as branch_id but its on url and it shows like

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

I think its not as POST, its GET.

I do not want to show param on URL, is there any way to hide it or how can I post it to action?

Thank you..

like image 800
Ninjin Avatar asked Sep 29 '22 09:09

Ninjin


1 Answers

With redirection you can only pass GET parameters. You can use action chaining as an alternative.

Check these posts for details:

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

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

like image 52
Chaitanya Avatar answered Oct 07 '22 20:10

Chaitanya