How to redirect an action with a parameter as a message in Struts?

Redirect the action to another struts.xml action:

 <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> 
Parameter

sent as branch_id but its on url and it shows how

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

I think this is not like POST, its GET.

I don’t want to show the parameter by URL, is there any way to hide it or how to place it in action?

Thanks..

+5
source share
1 answer

When redirecting, you can only pass GET parameters. You can use the action chain as an alternative.

Check these posts for details:

Can you redirect struts2 actions using POST instead of GET?

Punching Struts 1 from action to action with parameters as a POST request

+4
source

Source: https://habr.com/ru/post/1216661/


All Articles