From: dajevtic <nu...@jb...> - 2005-05-15 10:26:13
|
Hi. There may be no standard, but this code works just fine for us. Define a class to which all portlets have access and change it according to your needs: import java.util.Hashtable; public class InterPortletCommManager { private static InterPortletCommManager thisMgr = null; private Hashtable something; private InterPortletCommManager() { try { something = new Hashtable(); // do any initialization of local variables here } catch (Exception ex) { } } public static InterPortletCommManager getInstance() { if (thisMgr == null) { thisMgr = new InterPortletCommManager(); } return thisMgr; } public Object getObject(String portletId) { // retrieve an Object by using a portlet ID return something.get(portletId); } public void setObject(String portletId, Object someObject) { // use the ID of a portlet as a key for the object to be stored something.put(portletId, someObject); } } with InterPortletCommManager.getInstance() all portlets have access to the Vector "something". Of course you can create other methods and other objects to use amongst all portlets. Hope it helps. Regards, dj View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3877775#3877775 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3877775 |