> From: "James CE Johnson" <[EMAIL PROTECTED]>
>> bob mcwhirter wrote:
>>
>> >I -think- there are some scoping rules about variables usable within
>> a <define:tag>'s body.
>> >
>> >Or, we have also had some problems with ${booleanVar} not evaluating
>> correctly.
>> >
>> I think that's the more likely culprit since I'm trying to pass the
>> value of the "global" variable to the tag.
>>
>> What *does* work is:
>> <define:taglib...>
>> <define:tag ...>
>> <j:set var="unitTestSourcesPresent"
>> value='${context.getVariable("unitTestSourcesPresent")}'/>
>>
>> (I think that relates to your comment about scoping)
>>
>> But I really want to pass the value to the tag rather than expecting
>> that the global value is appropriate for all invocations of the tag.
>
> This *should* work. You should be able to pass in arguments to a tag;
I can pass arguments but the values all seem to come in as text. For
instance, an echo of the new tag attribute shows the value "true" but the
j:if is evaluating to false.
If the thing I try to pass as an attribute is null then none of the tag's
attributes are set.
> what actually happens is the tag gets its own variable scope with any
> parameters passed in along with the parent variable scopes. Have you
> tried just echoing the ${unitTestSourcesPresent} value? Is it null if
> you don't add the <j:set> tag? Maybe this is just a Jexl issue of coding
> your <j:if> to work properly?
I copied the j:if from the existing test plugin so I'm pretty sure my
syntax is correct.
>
> FWIW next week I'm going to try simplify the variable scopes in Jelly
> somewhat which might help remove any gremlins left in the
> Jelly-Maven-variable scope code.
>
I can try to put together a simple testcase if you like. Probably best to
wait until after your cleanup?
--
To unsubscribe, e-mail: <mailto:turbine-maven-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-maven-dev-help@;jakarta.apache.org>