You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Vincenz Braun <vb...@bigdot.de> on 2004/01/26 18:34:11 UTC

[jelly] Expressions and custom Tags

Hello,

It's been a while since I looked at some jelly source
code. Today I mentioned that some bean properties in
custom tags changed their type to Expression. The
real value is then obtained via expression.evaluate(context).

Take for example the email tag. Almost all attributes(like to and from)
have changed from String to Expression. Why is this necessary?
Do I have to change all my Tags attributes to Expression? Whats
the reason for this change? (There was a respective bug report JELLY-63)

The documentation states that all attributes are evaluated at runtime
and the properties are set to the respective values automatically. 
Is this still correct? Then I can not see why it is necessary to do this
magic stuff again, and again in the tags itself and why such a change in
EmailTag was necessary and the former version was considered a buggy.

Thanks a lot,
Vincenz Braun



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


Re: [jelly] Expressions and custom Tags

Posted by peter royal <pr...@apache.org>.
On Jan 26, 2004, at 12:34 PM, Vincenz Braun wrote:
> Take for example the email tag. Almost all attributes(like to and from)
> have changed from String to Expression. Why is this necessary?
> Do I have to change all my Tags attributes to Expression? Whats
> the reason for this change? (There was a respective bug report 
> JELLY-63)
>
> The documentation states that all attributes are evaluated at runtime
> and the properties are set to the respective values automatically.
> Is this still correct? Then I can not see why it is necessary to do 
> this
> magic stuff again, and again in the tags itself and why such a change 
> in
> EmailTag was necessary and the former version was considered a buggy.

I'm not certain why the change was made, but from a high-level the two 
approaches should be identical.

The main reason you would change from String (or whatever) to 
Expression is if you want to capture the Expression for later 
evaluation, or evaluation multiple times (with a different 
JellyContext)
-pete


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