各位大佬本自学小白又来问问题
resp.setCharacterEncoding("UTF-8");
req.setAttribute("list", list);
req.getRequestDispatcher("/index.jsp").forward(req,resp);
如何将servlet中的list传到,并遍历到表里
<table border="1">
<tr>
<th>员工编号</th>
<th>员工姓名</th>
<th>部门名称</th>
<th>签到时间</th>
</tr>
</table>
<table border="1">
<tr>
<th>员工编号</th>
<th>员工姓名</th>
<th>部门名称</th>
<th>签到时间</th>
</tr>
<c:forEach items="${list}" var="dataList">
<tr>
<td>${dataList.pin}</td>
<td>${dataList.Name}</td>
<td>${dataList.defaultdeptid}</td>
<td>${dataList.checktime}</td>
</tr>
</c:forEach>
</table>
我在jsp页面遍历之后出错
重: Servlet.service() for servlet [indexervlet] in context with path [/zpyr] threw exception [An exception occurred processing JSP page /index.jsp at line 33
30: <c:forEach items="${list}" var="dataList">
31: <tr>
32: <td>${dataList.pin}</td>
33: <td>${dataList.Name}</td>
34: <td>${dataList.defaultdeptid}</td>
35: <td>${dataList.checktime}</td>
36: </tr>
Stacktrace:] with root cause