struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darren Karstens <>
Subject If tag expression problem
Date Fri, 08 Oct 2010 09:06:25 GMT
I have the following code that displays a list of page numbers that
all have links except for the current page (defined by the request
parameter 'page'):

<s:iterator value="pages" var="it">
  <s:if test="#it==#parameters['page']">
    <s:property />
    <a href="/jwg-struts/create/displayCards.action?page=<s:property
/>"><s:property /></a>

However this doesn't work and the if condition is alway false. I tried
outputting the value of #it in each itteration and got the correct
values (numbers 1-5) and done the same with the #parameters['page']
and got the number 2. I also tried substituting the if tag for <s:if
test="#it==2"> and this worked!! The pages array in the action was an
array of ints so I thought maybe there is a type mismatch since the
request parameter would be a string so I tried converting the array to
strings but still no luck. Is this if tag valid? Can anyone tell me
where im going wrong?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message