掲示板

ActionResponse.sendRedirect() with post method

11年前 に Subhash Shah によって更新されました。

ActionResponse.sendRedirect() with post method

Junior Member 投稿: 78 参加年月日: 11/11/30 最新の投稿
Hi All,

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
thumbnail
11年前 に Mika Koivisto によって更新されました。

RE: ActionResponse.sendRedirect() with post method

Liferay Legend 投稿: 1519 参加年月日: 06/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.
11年前 に Subhash Shah によって更新されました。

RE: ActionResponse.sendRedirect() with post method

Junior Member 投稿: 78 参加年月日: 11/11/30 最新の投稿
Thanks for the response. I have been able to implement it successfully as suggested.
thumbnail
11年前 に Vishal Panchal によって更新されました。

RE: ActionResponse.sendRedirect() with post method

Expert 投稿: 289 参加年月日: 12/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