I'm getting more familar with the Jelly tags and I just came across a curious behavior. My script looks like this:
<j:forEach var="current" items="${strings}">
<j:set var="${current}" value="${current.concat(':value')}" />
<j:choose>
<j:when test="${current.equals('s2:value')}">
<j:set var="output" value="We found s2: ${current}" />
</j:when>
</j:choose>
</j:forEach>

where ${strings} is an ArrayList of strings.
What I expect to happen is that the first j:set tag sets a variable called 'current' with the current string value concatinated with ":value", so it would look like "s1:value", "s2:value", etc. Then I'm doing a test for for one of these values, "s2:value" and setting some other variable. However, the test is failing as the 'current' variable doesn't have the ':value' portion added. For example if I change the test to:

<j:when test="${current.startsWith('s2')}">

Then my 'ouput' variable becomes: 'We found s2: s2'
instead of 'We found s2: s2:value'

Is this correct?
- Robert McIntosh



--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to