フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Subhash Shah
ActionResponse.sendRedirect() with post method
2012/10/30 4:48
答え

Subhash Shah

ランク: Junior Member

投稿: 77

参加年月日: 2011/11/29

最近の投稿

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
2012/10/31 16:46
答え

Mika Koivisto

LIFERAY STAFF

ランク: Liferay Legend

投稿: 1505

参加年月日: 2006/08/07

最近の投稿

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
2012/11/12 1:51
答え

Subhash Shah

ランク: Junior Member

投稿: 77

参加年月日: 2011/11/29

最近の投稿

Thanks for the response. I have been able to implement it successfully as suggested.
Vishal Panchal
RE: ActionResponse.sendRedirect() with post method
2012/11/12 7:43
答え

Vishal Panchal

ランク: Expert

投稿: 279

参加年月日: 2012/05/20

最近の投稿

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