<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<!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=EUC-KR">
        <title> :: Employee List :: </title>
    </head>
    <body>
        <table border=1>
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Name</th>
                    <th>DOB</th>
                    <th>Salary</th>
                    <th>Active</th>
                    <th colspan=2>Action</th>
                </tr>
            </thead>
            <tbody> <!-- My warnings start from here for unknown tag... -->

            <c:forEach items="${employees}" var="employee">
                <tr>
                    <td><c:out value="${employee.employeeId}" /></td>
                    <td><c:out value="${employee.employeeName}" /></td>

                    <td><fmt:formatDate pattern="yyyy-MMM-dd" value="${employee.dob}" /></td>
                    <td><c:out value="${employee.salary}" /></td>
                    <td><c:out value="${employee.active}" /></td>
                    <td><a href="EmployeeServlet?action=edit&empId=<c:out value="${employee.employeeId}"/>">Update</a></td>
                    <td><a href="EmployeeServlet?action=delete&empId=<c:out value="${employee.employeeId}"/>">Delete</a></td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <p><a href="EmployeeServlet?action=insert">Add Employee</a></p>
    </body>
</html>

最佳答案

确保在构建路径中包括所有必需的jar,最重要的是,在JSP文档中缺少JSTL核心taglib的导入,请添加以下内容:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


有关更多信息,请看一下本教程:


How do I use JSTL on my JSPs?

09-28 14:07