Forums de discussion

IPC Mechanism

abc xyz, modifié il y a 11 années.

IPC Mechanism

New Member Publications: 11 Date d'inscription: 05/01/13 Publications récentes
Can any one tell me what are the disadvantages of IPC
1.Portlet session
2.Public render Parameter
3.Event
4.Client-side IPC
which one IPC is good to use and what are the advantages..plzz help me m really confusedemoticon
thumbnail
Abid Ali, modifié il y a 11 années.

RE: IPC Mechanism

Junior Member Publications: 88 Date d'inscription: 31/03/12 Publications récentes
1. PortletSession :- It used when your portlet are part of same portlet application, or if your portal-Server supports sharing session data between portlets in different portlet applicatons .

2. Public Render Parameter :- It used when your portlet communicate between single string value and are in different application .

3. Portlet Event :- its JSR 2.0 feature It used when your portlet communicate with each other by sending and receiving complex Objects and they are in different portlet application.

if you need more then u should go through the chapter no. 11 of Asish sharin's "Portlet in Action" book
abc xyz, modifié il y a 11 années.

RE: IPC Mechanism

New Member Publications: 11 Date d'inscription: 05/01/13 Publications récentes
can u give sample of cookies ipc.....how this is working??
Vaibhav Mittal, modifié il y a 11 années.

RE: IPC Mechanism

Junior Member Publications: 54 Date d'inscription: 16/07/12 Publications récentes
You can find e.g for cookie at the below link:

http://www.liferay.com/community/wiki/-/wiki/Main/Portlet+to+Portlet+Communication

Regards,
Vaibhav Mittal
abc xyz, modifié il y a 11 années.

RE: IPC Mechanism

New Member Publications: 11 Date d'inscription: 05/01/13 Publications récentes
i get idea from dis link nd i tried bt m not gettin cookie....dis is my code..
cookie1

@Override
public void processAction(ActionRequest request, ActionResponse response) throws IOException,PortletException{
String password="123456";
HttpServletResponse response1 = PortalUtil.getHttpServletResponse(response);
Cookie cookieParam = new Cookie("ankita", password);
cookieParam.setMaxAge(100);
response1.addCookie(cookieParam);



cookie2

public void doView(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
String sessionid = "";
Cookie[] cookies = renderRequest.getCookies();
Cookie cookiess[]=renderRequest.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
if (cookies.getName().equals("an")) {
sessionid = cookies.getValue();
System.out.println(sessionid);
break;
}

}
}


renderRequest.setAttribute("test", sessionid);
include(viewJSP, renderRequest, renderResponse);
}

view.jsp
Name:<%=renderRequest.getAttribute("test")%>