You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Lothar Krause <lo...@SDSC.EDU> on 2001/08/08 22:52:18 UTC

this VelocityContext from tool

Is there a way to figure out which context is currently used from within a
request pull-tool?

ie given "Example.vm"

...
$mytool.foo() or $mytool.foo(thisContext)
...

with class MyTool implements ApplicationTool {
   ...
   /* from init */
   RunData data;
   public String foo() {
      ...
      VelocityContext outerVC = ??????;
      /* so parameters set in outerVC appear within the screen */
      return renderInnerScreen(new VelocityContext(outerVC));
   }
}



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: this VelocityContext from tool

Posted by Jon Stevens <jo...@latchkey.com>.
on 8/9/01 8:35 AM, "John McNally" <jm...@collab.net> wrote:

> try TurbineTemplate.getTemplateContext(data)
> 
> john mcnally

Note that this is changing in T3.0.

It becomes:

Module.getTemplateContext(data)

Just for future reference. I had to hunt this one down last night.

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: this VelocityContext from tool

Posted by John McNally <jm...@collab.net>.
try TurbineTemplate.getTemplateContext(data)

john mcnally

Lothar Krause wrote:
> 
> Is there a way to figure out which context is currently used from within a
> request pull-tool?
> 
> ie given "Example.vm"
> 
> ...
> $mytool.foo() or $mytool.foo(thisContext)
> ...
> 
> with class MyTool implements ApplicationTool {
>    ...
>    /* from init */
>    RunData data;
>    public String foo() {
>       ...
>       VelocityContext outerVC = ??????;
>       /* so parameters set in outerVC appear within the screen */
>       return renderInnerScreen(new VelocityContext(outerVC));
>    }
> }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org