用于请求参数传递,一般是action到jsp页面。以键值对的形式保存起来, 前面是键“userlist”,后面是对应的值list。方便后面jsp页面取值
UsersServlet.java
request.setAttribute("userlist", list);
JSP
<c:forEach var="u" items="${userlist }"> <tr> <td class="tc"><input name="id[]" value="${u.USER_ID} " type="checkbox"></td> <td>${u.USER_ID}</td> <td>${u.USER_NAME}</td> <td>${u.USER_SEX=='T'?'男':'女'}</td> <td>${u.USER_EMAIL}</td> <td>${u.USER_MOBILE}</td>
</tr>
</c:forEach>