dev@jsftemplating.java.net

Re: JSFTemplating: questions about $attribute{attr2}

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Mon, 28 Jul 2008 17:04:16 -0700

A little bit of background as to "why" it is this way:

This EL syntax existed before JSF and has been carried over from a
previous web framework I wrote. The reason I carried it over was mainly
for 2 reasons: 1) EL cannot be nested; 2) EL cannot evaluate
context-sensitive expressions.

This EL syntax allows you to do things such as: $this{component} which
won't be available until JSF 2.0 (and they have to jump through some
hoops to do it!). And this EL can support nested expressions, including
nesting inside #{} expressions:
#{bean.$attribute{propertyName-$session{locale}}}. Despite these
advantages, I would really like to get rid of it to avoid confusion. :)
Currently you only *need* to use it when using output values from a Handler.

I think it would be a very good enhancement to JSFTemplating if we
allowed standard EL for an output value of EL. If anyone wants to file
an Issue for it at https://jsftemplating.dev.java.net I'll implement it
when I have time, hopefully soon. Or if someone else is interested in
doing this, I can show them where in the code to do it... shouldn't be
too hard.

Thanks!

Ken

Anissa Lam wrote:
>
> This is whats stored in the request scope.
> so $attribute{attr} is the same as saying #{requestScope.attr}
> The lines below means store the return value of jsft.echo to the
> request scope, and then get it back as the input value to println().
>
> Anissa.
>
> Rebecca Searls wrote:
>>
>> I'm trying to understand what $attribute is. Is this a JSP thing, an
>> EL thing?
>> What is its special handling of the return value from jsft.echo?
>>
>> <!afterEncode
>> jsft.echo(in='goodbye', out=>$attribute{attr2});
>> println(value= '$attribute{attr2}');
>> />
>