Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Subhash Shah
ActionResponse.sendRedirect() with post method
30. Oktober 2012 04:48
Antwort

Subhash Shah

Rang: Junior Member

Nachrichten: 77

Eintrittsdatum: 29. November 2011

Neue Beiträge

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. Oktober 2012 16:46
Antwort

Mika Koivisto

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1513

Eintrittsdatum: 7. August 2006

Neue 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
RE: ActionResponse.sendRedirect() with post method
12. November 2012 01:51
Antwort

Subhash Shah

Rang: Junior Member

Nachrichten: 77

Eintrittsdatum: 29. November 2011

Neue Beiträge

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

Vishal Panchal

Rang: Expert

Nachrichten: 279

Eintrittsdatum: 20. Mai 2012

Neue 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