Is there a way to have a custom Velocity Portlet where
we can put some objects into the Context and so can be
accessed from the Velocity Template?

Apparently, overriding the "getContent(RunData)" and
pushing some objects into it by doing this - (see code
below), does not work, as the populateContext id
overwritten by the parent i.e VelocityPortlet. So, I
ended up copying the entire code of
VelocityPortlet.java and adding a few lines of my own
code. Is there another way to do it?

//-------- start ------------------
     public ConcreteElement getContent( RunData rundata )
     {
         Context context = TurbineVelocity.getContext();
         context.put( "myname", "Ashwin Jayaprakash" );
         context.put( "dob", "Aug 24, 1996" );
         context.put( "site", "www.javaforu.com" );

         TurbinePull.populateContext(context, rundata);

         return super.getContent( rundata );
      }
//-------- end ------------------


Thanks,
Ashwin.

_________________________________________________________
Click below to visit monsterindia.com and review jobs in India or 
Abroad
http://monsterindia.rediff.com/jobs


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to