You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by ar...@za.safmarine.com on 2003/10/07 14:44:12 UTC
/ /OREF:CPT482FF Velocity context: portlet variable is null?
Hi,
I have a Velocity portlet with a doUpdate(...) action event that is
called when user clicks a form button.
Problem now is that when I try to get the portlet object from
Velocity context, null value is returned.
My doUpdate(...) method looks like this:
public void doUpdate(RunData data, Context context) throws Exception
{
try {
// get portlet reference from Velocity context
VelocityPortlet portlet = (VelocityPortlet) context.get
("portlet");
// announce null portlet
if (portlet == null) {
throw new NullPointerException(
"Velocity context contains a null reference
to this portlet!");
}
// use portlet object here to set Attributes!!!!
} catch(Exception exc) {
Log.error("MyWorldClockPortlet#doUpdate: [error] "
, exc);
throw exc;
}
}
I'm very new to Jetspeed so I'm not to sure why exectly the problem
may be occuring.
>From what I know, Jetspeed would set the "portlet" varibale in
Velocity context implictly.
Alen Ribic
Developer
Safmarine Computer Services (Pty) Ltd.
Tel: +27 21 4086588
Fax: +27 21 4086651
Email: aribic@za.safmarine.com
Web: http://www.scs.co.za
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org