Foros de discusión

ActionResponse.sendRedirect() with post method

Subhash Shah, modificado hace 11 años.

ActionResponse.sendRedirect() with post method

Junior Member Mensajes: 78 Fecha de incorporación: 30/11/11 Mensajes recientes
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, modificado hace 11 años.

RE: ActionResponse.sendRedirect() with post method

Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
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, modificado hace 11 años.

RE: ActionResponse.sendRedirect() with post method

Junior Member Mensajes: 78 Fecha de incorporación: 30/11/11 Mensajes recientes
Thanks for the response. I have been able to implement it successfully as suggested.
thumbnail
Vishal Panchal, modificado hace 11 años.

RE: ActionResponse.sendRedirect() with post method

Expert Mensajes: 289 Fecha de incorporación: 20/05/12 Mensajes recientes
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