> -----Original Message----- > From: Jason Trust [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 11, 2004 7:36 PM > To: Jetspeed Users List > Subject: RE: buildNormalContext called twice? > > > Alessandro, and all, > > I am trying to access the portlet from within an action > method - in this case doUpdate(rundata, context). > > public void doUpdate(RunData rundata, Context context) { > > JetspeedRunData jrundata = (JetspeedRunData) rundata; > Portlet portlet = (Portlet) context.get("portlet"); > > > It is in the context.get() that I have the issue when using > the action input parameter. From the doUpdate() method, I > don't see a way to get the Portlet object other than through > the context object, which returns null. I specifically need > that portlet object so that I can use it when setting the > PortletSessionState.setAttribute method. Is there another > way to get the portlet from within the doUpdate method which > does not return null when the action is added as an input > form parameter? > > I tried looking for many different paths, but no luck. It > could very well be my lack of knowledge on how to get the > portal object from the doUpdate method, but something tells > me I have run across a posting like this before which had not > been resolved.
When you call the action event by using the action input parameter, the action is called by Turbine, not by Jetspeed. But it is Jetspeed that adds the portlet and other data to the context, so that's why it's missing. But if you look at how PortletSessionState works, you see that all it uses is the portlet ID. What I did is wrote my own session helper methods, which take not the portlet object but the portlet ID as parameter, which you have to add to your request anyway. HTH -- Holger Dewes --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
