You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Brad Cox <bc...@virtualschool.edu> on 2002/02/01 03:37:06 UTC
DVSL returns values in the context??
Geir, I thought
#set($foo = $something)
in a dvsl script would store $foo in the incoming context. I was
hoping to retrieve
values on return as
Object foo = context.get("foo");
Apparently not; foo is null. What am I missing?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: How to pass values dvsl->java?????
Posted by Brad Cox <bc...@virtualschool.edu>.
Nevermind, Geir. Found it. The methods were public but the class
was not. Sorry.
On Friday, February 1, 2002, at 02:48 PM, Geir Magnusson Jr. wrote:
> Are your methods public?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: How to pass values dvsl->java?????
Posted by Brad Cox <bc...@virtualschool.edu>.
On Friday, February 1, 2002, at 02:48 PM, Geir Magnusson Jr. wrote:
> Are your methods public?
Absolutely.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: How to pass values dvsl->java?????
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Are your methods public?
On 2/1/02 1:17 PM, "Brad Cox" <bc...@virtualschool.edu> wrote:
> Geir, while waiting for your response I've tried passing an
> object to dvsl in the context with a method (addPage(String
> name, String value)) to save stuff as side effects.
>
> However the method isn't being recognized. In fact, none of my
> methods are recognized, just (presumably) those my class
> inherits from Object like getClass and toString().
>
> Here's the input. $cache is the object passed in the context.
> The fake(), fake1(), fake2() are methods I've added to help
> diagnose the problem, and addPage() is the real method.
>
> <pre>
> $cache
> $cache.getClass()
> $cache.toString()
> $cache.fake()
> $cache.fake1("foo")
> $cache.fake2("foo", "bar")
> $cache.addPage("foo", "bar")
> $cache.addPage($attrib.ident.toString(), $node.copy().toString())
> $cache.addPage($ident, $text)
> </pre>
>
> Here's the output. Note that getClass() and toString() are
> recognized, but none of my class-specific methods.
>
> <pre>
> edu.virtualschool.jcms.model.Task$PageCache@d115496
> class edu.virtualschool.jcms.model.Task$PageCache
> edu.virtualschool.jcms.model.Task$PageCache@d115496
> $cache.fake()
> $cache.fake1("foo")
> $cache.fake2("foo", "bar")
> $cache.addPage("foo", "bar")
> $cache.addPage($attrib.ident.toString(), $node.copy().toString())
> $cache.addPage($ident, $text)
> </pre>
>
> Roach motel. Data goes in but never come out. ;)
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
Geir Magnusson Jr. geirm@optonline.net
System and Software Consulting
"The J2EE Compatible brand has achieved significant momentum over the past
two years, and we want to make sure that any open source efforts don't
impact the viability of that effort. "
- Karen Tegan, Director of J2EE Compatibility and Platform Services
Sun Microsystems
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
How to pass values dvsl->java?????
Posted by Brad Cox <bc...@virtualschool.edu>.
Geir, while waiting for your response I've tried passing an
object to dvsl in the context with a method (addPage(String
name, String value)) to save stuff as side effects.
However the method isn't being recognized. In fact, none of my
methods are recognized, just (presumably) those my class
inherits from Object like getClass and toString().
Here's the input. $cache is the object passed in the context.
The fake(), fake1(), fake2() are methods I've added to help
diagnose the problem, and addPage() is the real method.
<pre>
$cache
$cache.getClass()
$cache.toString()
$cache.fake()
$cache.fake1("foo")
$cache.fake2("foo", "bar")
$cache.addPage("foo", "bar")
$cache.addPage($attrib.ident.toString(), $node.copy().toString())
$cache.addPage($ident, $text)
</pre>
Here's the output. Note that getClass() and toString() are
recognized, but none of my class-specific methods.
<pre>
edu.virtualschool.jcms.model.Task$PageCache@d115496
class edu.virtualschool.jcms.model.Task$PageCache
edu.virtualschool.jcms.model.Task$PageCache@d115496
$cache.fake()
$cache.fake1("foo")
$cache.fake2("foo", "bar")
$cache.addPage("foo", "bar")
$cache.addPage($attrib.ident.toString(), $node.copy().toString())
$cache.addPage($ident, $text)
</pre>
Roach motel. Data goes in but never come out. ;)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: DVSL returns values in the context??
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 1/31/02 9:37 PM, "Brad Cox" <bc...@virtualschool.edu> wrote:
> Geir, I thought
>
> #set($foo = $something)
>
> in a dvsl script would store $foo in the incoming context. I was
> hoping to retrieve
> values on return as
>
> Object foo = context.get("foo");
>
> Apparently not; foo is null. What am I missing?
>
Well, 'foo', apparently.
(I crack myself up...)
The whole DVSL context thing is a little complicated. Not hard, just not
simple.
So what's happening is that I need to change it so that any 'puts' go into
the 'user context'.
There was some reasoning for the way it is, but I can't remember now. I'll
try and recall - if nothing but fuzzy thinking on my part, I'll fix....
--
Geir Magnusson Jr. geirm@optonline.net
System and Software Consulting
"We will be judged not by the monuments we build, but by the monuments we
destroy" - Ada Louise Huxtable
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>