留言板

How can i send custom parameter to another portlet on different page.

thumbnail
Omkar Khandare,修改在11 年前。

How can i send custom parameter to another portlet on different page.

Junior Member 帖子: 49 加入日期: 12-3-7 最近的帖子
I want to send my custom parameter to a different portlet from my current portlet's jsp page
using javascript.
How can i do that..??

I am passing my custom parameter to javascript function & appending to URL of calling page.
calling page have new portlet so its default doView() method get called.
but i am unable get my parameter i appended to URL.

through
request.getParameter("myParameter");

How it can achieved..??
plz help.
thumbnail
Juhi Kumari,修改在11 年前。

RE: How can i send custom parameter to another portlet on different page.

Expert 帖子: 347 加入日期: 11-12-12 最近的帖子
Hi Omkar,

Communication between two portlets can be done using IPC.
Check this link
and this wiki.

Regards
Juhi
thumbnail
Omkar Khandare,修改在11 年前。

RE: How can i send custom parameter to another portlet on different page.

Junior Member 帖子: 49 加入日期: 12-3-7 最近的帖子
If i want to Portlet Session to send parameter then..

How can i use Portlet session in javascript function
to set parameter using seAttribute() function of PortletSession.??
thumbnail
Juhi Kumari,修改在11 年前。

RE: How can i send custom parameter to another portlet on different page.

Expert 帖子: 347 加入日期: 11-12-12 最近的帖子
Hi,
You can't do it directly. Becouse session are controlled by server and
javascript runs client side.

Regards
Juhi
thumbnail
Jitendra Rajput,修改在11 年前。

RE: How can i send custom parameter to another portlet on different page.

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
Try by using HttpRequest to get the parameter from URL.

HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request);
httpRequest = PortalUtil.getOriginalServletRequest(httpRequest);
httpRequest.getParameter("myParameter");
thumbnail
Omkar Khandare,修改在11 年前。

RE: How can i send custom parameter to another portlet on different page.

Junior Member 帖子: 49 加入日期: 12-3-7 最近的帖子
Hi Jitendra,

It worked for me Thanks.
i am able to read url parameter using code given by You.

I have only added following two lines in liferay-portlet.xml file.

<private-request-attributes>true</private-request-attributes>
<private-session-attributes>false</private-session-attributes>

It doesn't work without these for me.

Thank You very much.
thumbnail
Jitendra Rajput,修改在11 年前。

RE: How can i send custom parameter to another portlet on different page.

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
For private-request-attributes by default it is true only and you are setting and getting parameter from request so it should work even if don't set private-request-attributes to true.

<!--
Set the private-request-attributes value to true if the portlet does not share
request attributes with the portal or any other portlet. The default value is
true. The property "request.shared.attributes" in portal.properties specifies
which request attributes are shared even when the private-request-attributes
value is true.
-->
<!ELEMENT private-request-attributes (#PCDATA)>