根据TLD标签测试必须为空



我的大学项目中有这个jsp文件,当尝试运行它时,我收到此错误:根据标签文件中的TLD或属性指令,属性测试不接受任何表达式。我应该怎么做才能解决它?感谢您的赞赏。

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
  <head>
    <title>Chat Joined</title>
  </head>
 <body>
<c:if test="${pageContext.request.method=='POST'}">   <-- here error happens
  <c:choose>
    <c:when test="${param.send!=null}">
      <c:set var="chat"
      value="${chat}<b>${param.uid}:</b>${param.text}<br />"
       scope="application" />
    </c:when>
    <c:when test="${param.clear!=null}">
      <c:set var="chat" value="" scope="application" />
    </c:when>
  </c:choose>
</c:if>
<table border="0">
  <tbody>
    <tr>
      <td>
        <h3>User: 
        <c:out value="${param.uid}" />
        </h3>
        <hr />
      </td>
    </tr>
    <tr>
      <td>
        <c:out value="${chat}" escapeXml="false" />
      </td>
    </tr>
    <tr>
      <td>
        <hr />
        <form method="post">Message:
        <input type="text" name="text" size="20" />
        <input type="submit" name="send" value="Send" />
        <input type="submit" name="refresh" value="Refresh" />
        <input type="submit" name="clear" value="Clear" />
        <input type="hidden" name="uid"
        value="<c:out value="${param.uid}"/>" />
        <br />
        </form>
      </td>
    </tr>
  </tbody>
</table>

尝试在声明中使用它,而不是现在使用的

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

最新更新