I'm thinking this is the desired behavior. First of all, I think it's wrong to
use the dot notation for the "var" attribute of <j:set. This style should be
limited to o.a.c.j.e.ConstantExpression's, which is the type of any variables
that are created from properties files. Using
<j:set ... value="${my.property}"/> will create a variable of that same type
(ConstantExpression). While <j:set ...>${my.property}</j:set> creates a new
variable of type String. So, my conclusion is that (correct me if I'm wrong)
in order to use a property variable in an expression like
<j:if test="${myProperty == 'someValue'}"> you must first create a variable of
type String:
<j:set var="myProperty">${my.property}</j:set>
-Ben
Quoting Ben Anderson <[EMAIL PROTECTED]>:
> Hi,
> I've noticed that there is a distinct difference with properties declared in
> a
> .properties file vs. properties set using <j:set. I'm wondering if this is
> the
> desired behavior or a bug. For instance:
>
> build.properties
> ----------------
> my.property=myValue
>
> maven.xml
> ---------
> <ant:echo>${my.property}</ant:echo>
> <j:if test="${my.property == 'myValue'}">
> <ant:echo>true</ant:echo>
> </j:if>
>
> outputs:
> [echo] myValue
>
> notice that "[echo] true" is not output.
>
> now if I do this:
> maven.xml
> ---------
> <j:set var="my.property" value="myValue"/>
> <ant:echo>${my.property}</ant:echo>
> <j:if test="${my.property == 'myValue'}">
> <ant:echo>true</ant:echo>
> </j:if>
>
> outputs:
> [echo] myValue
> [echo] true
>
> Why this difference? Am I doing something wrong? Any thoughts?
> Thanks,
> Ben
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]