Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Subhash Shah
ActionResponse.sendRedirect() with post method
30 ottobre 2012 4.48
Risposta

Subhash Shah

Punteggio: Junior Member

Messaggi: 77

Data di Iscrizione: 29 novembre 2011

Messaggi recenti

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 ottobre 2012 16.46
Risposta

Mika Koivisto

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1513

Data di Iscrizione: 7 agosto 2006

Messaggi recenti

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 novembre 2012 1.51
Risposta

Subhash Shah

Punteggio: Junior Member

Messaggi: 77

Data di Iscrizione: 29 novembre 2011

Messaggi recenti

Thanks for the response. I have been able to implement it successfully as suggested.
Vishal Panchal
RE: ActionResponse.sendRedirect() with post method
12 novembre 2012 7.43
Risposta

Vishal Panchal

Punteggio: Expert

Messaggi: 280

Data di Iscrizione: 20 maggio 2012

Messaggi recenti

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