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]Expression as an attribute
Date Fri, 27 Sep 2002 13:21:07 GMT
From: "Kurt Rush" <krush@mindspring.com>
> Hey James,
>
> Thanks for the feedback. I found the problem elsewhere. I was creating a
> context for the tag before I executed it and I did not set the old
> context to be the parent of the new context. So the attribute 'value'
> could not find a variable called 'name'. Hence no value in 'value'.
> Sorry for the waste of bandwidth.

No problem. Glad it all worked out.

I'll definitely add this to the FAQ shortly...

James
-------
http://radio.weblogs.com/0112098/

>
> >Both approaches should work. If you have a setter method
> >
> >public class EjbParamTag {
> >    public void setValue(Object value);
> >}
> >
> >then the expression ${name} would be evaluated first, then the result of
the
> >expression would be passed in to your tag. Many existing Jelly tags work
> >like this so that their values can be set via expressions.
> >
> >Though if you actually wanted an Expression instance, so that you could
> >coerce the result somewhat (such as to call
Expression.evaluateAsIterator()
> >for example) then just use a setter method of type Expression.
> >
> >public class EjbParamTag {
> >    public void setValue(Expression expr);
> >}
> >
> >
> >This is how several tags work (such as the <x:forEach> tag, iterating
over
> >XPath expressions).
> >
> >
> That's a great explanation, thanks. I think it would be a good addition
> to the faq.
>
> >I'm just wondering if you Tag code is confusing the bean introspector
maybe?
> >Do you have any methods called isValue() or getValue() of wierd return
> >
> Yea I could see that being a problem, fortunately I do not have that one.
>
> >types? Any chance you could post an example tag that doesn't work - I
could
> >then add it as a JellyUnit test case...
> >
> Sorry no unit test for my stupidity :)
>
> >
> >
> Thanks,
> Kurt
>
> --
> 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