源码:<s:iterator value="#request.allUsers" id="user">
<tr>
<td bordercolor="#FFFFFF">${user.loginName}</td>
<td bordercolor="#FFFFFF">${user.name}</td>
<td bordercolor="#FFFFFF">${user.department.name}</td>
<td bordercolor="#FFFFFF">
<s:iterator value="${user.roles}" id="role">
${role.name}
</s:iterator>
</td>
<td bordercolor="#FFFFFF">${user.description}</td>
<td bordercolor="#FFFFFF">
<a href="user_delete?id=${role.id}">删除</a>
<a href="user_savePage?id=${role.id}">修改</a>
<a href="">初始化密码</a>
</td>
</tr>
</s:iterator>
错误:According to TLD or attribute directive in tag file, attribute value does not accept any expressions
原因:struts2的s标签不支持el,但是支持ognl,所以改为:
<s:iterator value="#user.roles" id="role">
${role.name}
</s:iterator>