commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [jelly] Subclassing JellyContext
Date Mon, 09 Dec 2002 07:58:29 GMT
> What I meant to say was that a variable _value_ should be visible only in
a certain
> scope.  So there is a stack of values per variable.

You could create a number of different contexts each of which can contain
different values of a given variable name. e.g.

<j:set var="foo" value="1"/>
<j:scope>
    <j:set var="foo" value="2"/>

    <j:scope>
        <j:set var="foo" value="3"/>
        ${foo}
    </j:scope>
    ${foo}
</j:scope>
${foo}

which would output "3 2 1". i.e. that the above implements a stack of
variable values of the 'foo' variable.

James
-------
http://radio.weblogs.com/0112098/
----- Original Message -----
From: <Ext-Mike.Hogan@nokia.com>
To: <commons-dev@jakarta.apache.org>
Sent: Monday, December 09, 2002 6:48 AM
Subject: RE: [jelly] Subclassing JellyContext


> Variables should automatically be available to their child
> contexts so I
> don't think you need to create your own JellyContext for that.

What I meant to say was that a variable _value_ should be visible only in a
certain
scope.  So there is a stack of values per variable.

> Also the push/pop features can be used by just creating and
> using child
> context - its rather like using a local block in Java.

Ok, I will look into this - this should help.

> There's also the
> <j:scope> tag which creates a child variable scope,
> essentially making any
> variables set inside the <j:scope> tag
>
> One question; where will you be using these typesafe getters
> and setters you
> want? Will it be inside a Jelly Tag implementation?

Unfortunately no.  The application has to put about 10 values in the context
before the Jelly Tags can do their work.  Right now I am doing it via a
"ContextHelper"
class.

Thanks for the help,
Mike.

--
To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message