Hi, Andy:
I put my objects into TemplateContext in Action time and time again,
they always work. If the request link is
$link.setAction("FooAction").setPage("MyFooBar.vm"), I think you can get
the reference in .VM with no problem.
Use doPerform() or doXxxxxx() method in Action instead of
doBuildTemplate().
Good luck.
Joel
-----Original Message-----
From: Andy Whalen [mailto:[EMAIL PROTECTED]]
Sent: 2002��7��14�� 13:59
To: [EMAIL PROTECTED]
Subject: Velocity Context Objects being dropped
Hi,
As per the thousands of recommendations scattered throughout this
newsgroup, I have stuck with Turbine 2.1 to develop an intranet site.
This framework is tremendous!
I'm having one little problem: I'm using VM templates for my front end,
but for some reason, whenever I instantiate an object and insert it into
the Context, it disappears upon instantiation of the next page. I.e.,
in FooAction.java
doBuildTemplate( data, context ) {
context.put( "bar", new Bar() );
}
then, on the next page that loads, MyFooBar.vm:
$bar.toString()
prints out an error message, "$bar.toString() is an invalid reference."
Indeed, if I do a S.o.p. of "context.get( "bar" )" in the class matching
MyFooBar.vm, it says "null".
Oh contrare!
The RunData object is there, but that's all - I can't get any other type
of object to "stick". In Turbine Velocity, there's no "merge" function
like in standalone Velocity, so I'm frankly out of ideas.
Does anyone have any wisdom they could impart upon me? I am in
desperation!
Best,
================================
Andy Whalen
http://www.andywhalen.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>