首页 > 解决方案 > Jsp 在第 9 行和第 12 行返回错误:javax.servlet.jsp.PageContext 无法解析为类型

问题描述

请帮助我理解为什么以下 2 行(第 9 行和第 12 行)给出错误?如果我没有href标签,它不会给出任何错误,但是当我添加它时会失败,所以我们需要做些什么来使用href标签

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>List of Instructor</title>
<link type="text/css" 
      rel="stylesheet" 
      **href="${pageContext.request.contextPath}/resources/css/instructorlist.css" />**
</head>
<body>
    **<div id="header">**
        <h2> List of Instructors in Tution Center </h2>
    </div>
    <div id="container">
        <table>
            <tr>
                <th>Id</th>
                <th>Name</th>
                <th>Date of Birth</th>
                <th>Email</th>
                <th>LinkedIn Profile</th>
                <th>Insta profile</th>
                
            </tr>
            <c:forEach var="tempInstructor" items="${instructorsInfo}">
                <tr>
                    <td>${tempInstructor.instructorPersonalInfo.id}</td>
                    <td>${tempInstructor.instructorPersonalInfo.name}</td>
                    <td>${tempInstructor.instructorPersonalInfo.dateOfBirth}</td>
                    <td>${tempInstructor.instructorDigitalInfo.email}</td>
                    <td>${tempInstructor.instructorDigitalInfo.linkedIn}</td>
                    <td>${tempInstructor.instructorDigitalInfo.instaProfile}</td>
                </tr>
            </c:forEach>
        </table>
    </div>
</body>
</html>```

标签: jspjsp-tags

解决方案


推荐阅读