-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 09 May 2002 12:46 pm, David Sean Taylor wrote:
> Raphael,
>
> Why is there more than one context?
>
> In a turbine action, if I do
>
> Context context = TurbineVelocity.getContext(data);
> context.put("thing", thing);
>
> And then in a velocity page, I try
>
> $thing
>
> It doesn't find it.
>
> Thanks,
>
> David
Isn't the controller going to drop whatever you've placed in the context
after the action is run?
I haven't looked at the code for TurbineVelocity but it looks like the
VelocityPortletController uses the getContext() method which is getting a
new (blank) context object.
public class VelocityPortletController extends AbstractPortletController
{
public ConcreteElement getContent( RunData rundata )
{
// create a blank context and with all the global application
// Pull Tools inside
Context context = TurbineVelocity.getContext();
context.put( "data", rundata );
context.put( "controller", this );
....
There is an empty buildContext method in VelocityPortletController that you
might use. Place the context objects in a session var (or use setTemp) and
then write a custom buildContext method to pull the object into the context.
Then again - I may be wayyyyyy off base!
DP
- --
David G. Powers
PowerSource
-----BEGIN PGP SIGNATURE-----
Comment: Verify the authenticity of this message with the public key available at
http://pssp.com/dgp_pk.asc
iD8DBQE82yOcjmjAPDT0/nERArB+AJ9oxRCZeoP3b3GscvprwwZw43i4dACg5n1I
nt4A2LDtQHiDaTGMFLwC6AQ=
=oUC+
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>