• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

portlet communication - sending object not string...

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we send any object other than string to one portlet from another portlet?

Thanks.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
greenhorn
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic