| Author |
Passing parameter between Portlet
|
|
| Calvin 2004-01-19, 2:54 pm |
| Hi,
Just wondering whether it is possible to pass parameter between separate
portlet. Solution for either passing it from PortletRequest or
PortletSession object would be greatly appreciated.
Thanks,
Calvin
| |
| rsoika 2004-01-19, 2:59 pm |
| If you whant to pass parameter between diferent portlets you have to use Messages.
Send a Messeg in your ActionPerformend Methode :
...
/*** Send a Message... ***/
if(event.getActionString().equals("myURI")) {
getPortletConfig().getContext().send(null, "my message");
....
your can recive your message in a diferent portlet in the
Methode: messageReceived (implement the "MessageListener" Interface!)
public void messageReceived(MessageEvent event) throws PortletException {
// MessageEvent handler
PortletMessage msg = event.getMessage();
// Add PortletMessage handler here
// handel your message...
}
...
Ralph Soika
| |
| rsoika 2004-01-19, 2:59 pm |
| <P>your have to use the Portlet API in a way like this:<BR>
<BR>
<a href="<portletAPI:createURI><portletAPI:URIAction
name="myURI" /><portletAPI:URIParameter
name="myKey"
value="<%=myValue%>"/></portletAPI:createURI>"><BR>
<BR>
<BR>
Then you can query your param in the Methode: actionPerformed() <BR>
...<BR>
public void actionPerformed(ActionEvent event) throws PortletException {<BR>
......<BR>
if(event.getActionString().equals("myURI")) {<BR>
System.out.println("MyKey= ....."+(String)event.getRequest().getParameter("nyJey"));<BR>
}<BR>
.......<BR>
</P>
<P><BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</P>
Ralph Soika
|
|
|
|