I try your solution, and it work's .
I think the problem is that the forEach tag is generating a numeric
type for the clientnum variable and the ${clients[clientnum]} syntax is
failing to interpret the expression correctly because it can't use an
int to index a map and isn't making the leap to try and coerce the
value to a string. If you convert the clientnum to a string explicitly
it will work:
Add this at the top:
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"
%>
and use:
Value: ${clients[fn:toLowerCase (clientnum)]}
alternately, if the only information being carrier in the map keys is
an integer perhaps a List would do?
<%
final List clients = new ArrayList ();
clients.add ("John");
clients.add ("Peter");
clients.add ("Gerald");
request.setAttribute ("clients", clients);
%>
<c:forEach var="client" varStatus="status" items="${clients}">
${status.count}: '${client}' <br/>
</c:forEach>
--lee
jgmaux@telefonica.net wrote:
Thanks, Steve.
I try your solution, but I have same problem.....
Steve ha escrito:
The problem is with the nested expressions, which you shouldn't need.=