commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Gilde <hgilde-comm...@earthlink.net>
Subject RE: [jira] Created: (JELLY-163) Allow Expressions to throw exceptions
Date Tue, 23 Nov 2004 05:16:31 GMT
Paul,

For most tags, expressions are evaluated at runtime, but immediately before
the tag itself becomes aware of them. They're evaluated by the enclosing
TagScript (a Script that runs a Tag) immediately before the tag itself is
run. The tag just knows about the result of the expression, not the actual
evaluation.

An exception at this time could be caught by the enclosing tag, but not by
the tag that should have received the expression. So, there's currently no
generic way to have a tag say "don't worry about expression evaluation
failures, just show me the contents/null/whatever".

Your example would work fine, the exception would be thrown out of the
script or could be caught by an enclosing tag.

Hans

-----Original Message-----
From: Paul Libbrecht [mailto:paul@activemath.org] 
Sent: Monday, November 15, 2004 5:14 AM
To: Jakarta Commons Developers List
Subject: Re: [jira] Created: (JELLY-163) Allow Expressions to throw
exceptions

Hans,

I think this is exactly what made me stumble... I don't really get 
this...
(I'm again about my fuzzyness of understanding jelly lifecycle... sorry 
for this!). I see two times where such an exception can occur:
- at compilation time. This should be the same when a tag would meet 
unknown attributes or a (strict) taglib would meet an unknown tag.
- at execution time, when the expression should return something 
(maybe).
In both cases, the exception should be thrown and wrapped into some 
generic exception which should include location information.

My current attempt was the script:
<j:jelly xmlns:j="jelly:core">
     <j:set var="b" value="blop"/>
     ${b-'b'}
</j:jelly>
Which did throw me an exception (as I instructed it) but which was not 
caught, or wrapped...

In which of the two phases should such a thing be caught ?
Are there other phases ?

thanks

paul


Le 15 nov. 04, à 02:32, Hans Gilde (JIRA) a écrit :

> Expressions are evaluated before the tag is run, so it normally 
> wouldn't know anything about them.


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


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


Mime
View raw message