Foren

ActionResponse.sendRedirect() with post method

Subhash Shah, geändert vor 11 Jahren.

ActionResponse.sendRedirect() with post method

Junior Member Beiträge: 78 Beitrittsdatum: 30.11.11 Neueste Beiträge
Hi All,

I am facing an issue and couldn't find solution. We have following code in one of our portlets:

PortletURL url = ((ActionResponseImpl) actionResponse).createActionURL();
url.setParameter(SiriusRegistrationConstants.STRUTS_ACTION, "/login/login");
url.setParameter("saveLastPath", "0");
url.setParameter("redirect","/");
url.setParameter("login", screenName);
url.setParameter("password",password);
url.setParameter("rememberMe", "true");
actionResponse.sendRedirect(url);


Now the problem is when the following code is executed the URL in the browser address bar shows the parameters in the query string. Is there a way that this URL can be redirected using http POST method so that the parameters can't be seen in the address bar of the browser?

Thanks
thumbnail
Mika Koivisto, geändert vor 11 Jahren.

RE: ActionResponse.sendRedirect() with post method

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
You can't make redirect use POST. What you can do is render a html form to the browser with javascript to auto submit it.
Subhash Shah, geändert vor 11 Jahren.

RE: ActionResponse.sendRedirect() with post method

Junior Member Beiträge: 78 Beitrittsdatum: 30.11.11 Neueste Beiträge
Thanks for the response. I have been able to implement it successfully as suggested.
thumbnail
Vishal Panchal, geändert vor 11 Jahren.

RE: ActionResponse.sendRedirect() with post method

Expert Beiträge: 289 Beitrittsdatum: 20.05.12 Neueste Beiträge
Mika Koivisto:
You can't make redirect use POST. What you can do is render a html form to the browser with javascript to auto submit it.


Hi All,

Useful stuff.

Thanks&Regards,
Vishal R. Panchal