ask God to answer ha, I have tried many times, but it still doesn"t work. It can"t be displayed on the jsp page. I don"t know why.
backend code:
servlet code:
EmployeeDao employeeDao = new EmployeeDaoImpl();
List<Employee> employeeList = employeeDao.findAllEmployee();
request.setAttribute("empList", employeeList);
request.getRequestDispatcher("/test.jsp").forward(request, response);
Front end code:
:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
foreach:
<table>
<tr>
<th>ID</th>
<th></th>
</tr>
<tr>
<c:forEach items="${empList}" var="aa">
<th>${aa.employeeId}</th>
<th>${aa.employeeName}</th>
</c:forEach>
</tr>
</table>
I debugged servlet:
it is obvious that there is value here, but it just can"t be passed on.
ask for answers