this is my empInfo.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>empInfo.jsp</title>
</head>
<body>
<div>
<table>
<tr>
<td><a href="pages/addEmp.jsp">添加</a></td>
</tr>
<tr>
<td>eno_id </td>
<td>员工姓名</td>
...
<c:out value="${emp_info}" />
<td>操作</td>
</tr>
<%-- Debugging to check if emp_info is populated --%>
<cut value="${emp_info}" />
<c:forEach items="${emp_info}" var="emp">
<tr>
<td>${emp.eno}</td>
...
<td>${emp.dno}</td>
<td><a href="/emps/delEmpByeno?eno=${emp.eno}">删除</a>
</tr>
</c:forEach>
</table>
</div>
</body>
</html>
this is my controller:
@Controller
@RequestMapping("/emps")
public class EmpController extends BasicController{
@Autowired
private EmpSerive empSerive;
@GetMapping("/selectAll")
public String getAllEmp(Model model){
List<Employee> employeeList = empSerive.selectAllEmp();
model.addAttribute("emp_info",employeeList);
return "empInfo";
}
when i debug the empInfo.jsp, the Idea says : cannot find the local variables. like the picture.
[enter image description here](https://i.sstatic.net/eAkg0Z6v.png)
what should I do to show the data to jsp which datas from database?enter image description here
New contributor
一透様 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.