jsp - foreach loop variable accessing from outside -
how access variable in foreach loop outside ? when try it, takes last value. have click on button open wind , need use value of row clicked, takes last value.
i use loop <c:set var="q" value="${p.getiduser()}" />
and outside loop <a href='deleteuser?id=${q}'>
but takes last row.
yo can put row row no c:set var identify uniquely each c set variable
q+row_number q${foreach_varstatus_variable.count}
like
<c:set var="q${foreach_varstatus_variable.count}" value="${p.getiduser()}"/>
outside foreach:
<a href='deleteuser?id=${q1}'> <a href='deleteuser?id=${q2}'>
or access c set q+row_number.
Comments
Post a Comment