Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Subhash Shah
ActionResponse.sendRedirect() with post method
30 de Outubro de 2012 04:48
Resposta

Subhash Shah

Ranking: Junior Member

Mensagens: 77

Data de entrada: 29 de Novembro de 2011

Mensagens recentes

Hi All,

I am facing an issue and couldn't find solution. We have following code in one of our portlets:
 1
 2PortletURL url = ((ActionResponseImpl) actionResponse).createActionURL();
 3url.setParameter(SiriusRegistrationConstants.STRUTS_ACTION, "/login/login");
 4url.setParameter("saveLastPath", "0");
 5url.setParameter("redirect","/");
 6url.setParameter("login", screenName);
 7url.setParameter("password",password);
 8url.setParameter("rememberMe", "true");
 9actionResponse.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
RE: ActionResponse.sendRedirect() with post method
31 de Outubro de 2012 16:46
Resposta

Mika Koivisto

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1513

Data de entrada: 7 de Agosto de 2006

Mensagens 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
RE: ActionResponse.sendRedirect() with post method
12 de Novembro de 2012 01:51
Resposta

Subhash Shah

Ranking: Junior Member

Mensagens: 77

Data de entrada: 29 de Novembro de 2011

Mensagens recentes

Thanks for the response. I have been able to implement it successfully as suggested.
Vishal Panchal
RE: ActionResponse.sendRedirect() with post method
12 de Novembro de 2012 07:43
Resposta

Vishal Panchal

Ranking: Expert

Mensagens: 280

Data de entrada: 20 de Maio de 2012

Mensagens recentes

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