Can you redirect struts2 actions using POST instead of GET?

<action name="actionA" class="com.company.Someaction"> <result name="success" type="redirect-action"> <param name="actionName">OtherActionparam> <param name="paramA">${someParams}</param> <param name="paramB">${someParams}</param> <param name="aBoatLoadOfOtherParams">${aBoatLoadOfOtherParams}</param> </result> </action> 

In the action map above, I redirect from SomeAction to OtherAction. I have problems because, unfortunately, I need to transfer a large amount of data between two actions. IE7 will only allow GET requests as 2k, so it bloat when I am a bit above this limit, when the response triggers a request for another action.

Is it possible to set this forwarding so that the POST is ultimately called for another action?

+6
redirect post struts struts2 action
source share
1 answer

As the docs say:

The only way to transfer data [after redirection] is a session with or with web parameters (url? Name = value) [i.e. query string for a GET request]

Perhaps for a chain of actions ? I'm not sure, and this is usually not recommended, but it seems like the script is quite unusual, so it can pay to take a look.

In this case, we do not redirect, i.e. we do not return to the client, but save everything on the server. Presumably, then the full interceptor stack is executed again - and the published data should influence the new action, hopefully ...

+6
source share

All Articles