| Author |
portlet communication - sending object not string...
|
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
|
|
Can we send any object other than string to one portlet from another portlet? Thanks.
|
 |
Mouli Velu
Greenhorn
Joined: Oct 06, 2005
Posts: 12
|
|
Hi, you can pass the string message to the portlets in any of the portlet application. You can use DefaultPortletMessage interface for this. But messages other than string can be passed to the same portlet application only. you can make use of PortletMessage interface for this. I have done this in IBM Portlet API.
|
Regards<br />S.Mouli
|
 |
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
|
|
Originally posted by Mouli Velu: Hi, you can pass the string message to the portlets in any of the portlet application. You can use DefaultPortletMessage interface for this. But messages other than string can be passed to the same portlet application only. you can make use of PortletMessage interface for this. I have done this in IBM Portlet API.
Could you please put some more details or code sample here. It will really help me a lot. Thanks a lot.
|
 |
Mouli Velu
Greenhorn
Joined: Oct 06, 2005
Posts: 12
|
|
Hi, This is for passing string messages from one portlet to another. public void messageReceived(MessageEvent event) throws PortletException { PortletMessage message = event.getMessage(); if (message instanceof DefaultPortletMessage) { String msgText = ((DefaultPortletMessage) message).getMessage(); event.getRequest().setAttribute("IsAnyMessage", msgText); System.out.println("Inside MessageReceived, message = " + msgText);} } you can more details from the link below: http://www-128.ibm.com/developerworks/websphere/library/techarticles/0402_konduru/0402_konduru.html
|
 |
pooja jain
greenhorn
Ranch Hand
Joined: Jan 12, 2005
Posts: 213
|
|
Originally posted by rathi ji: Can we send any object other than string to one portlet from another portlet? Thanks.
yes. session attribute in application scope will do, if portlets are in same war. if not, use common place (db, xml). also look for portlet wiring from ibm.
|
:d
|
 |
 |
|
|
subject: portlet communication - sending object not string...
|
|
|