Fórum
ActionResponse.sendRedirect() with post method
Subhash Shah, modificado 11 Anos atrás.
ActionResponse.sendRedirect() with post method
Junior Member Postagens: 78 Data de Entrada: 30/11/11 Postagens Recentes
Hi All,
I am facing an issue and couldn't find solution. We have following code in one of our portlets:
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
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
Mika Koivisto, modificado 11 Anos atrás.
RE: ActionResponse.sendRedirect() with post method
Liferay Legend Postagens: 1519 Data de Entrada: 07/08/06 Postagens Recentes
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 11 Anos atrás.
RE: ActionResponse.sendRedirect() with post method
Junior Member Postagens: 78 Data de Entrada: 30/11/11 Postagens Recentes
Thanks for the response. I have been able to implement it successfully as suggested.
Vishal Panchal, modificado 11 Anos atrás.
RE: ActionResponse.sendRedirect() with post method
Expert Postagens: 289 Data de Entrada: 20/05/12 Postagens RecentesMika 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