【问题标题】:The request object is accessed in the JSTL tag via pageContext [duplicate]通过 pageContext 在 JSTL 标记中访问请求对象 [重复]
【发布时间】:2020-06-29 17:04:38
【问题描述】:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:if test="${"POST".equalsIgnoreCase(pageContext.request.method) && pageContext.request.getParameter("submit") !=null}">
</c:if>

此代码段我收到此错误。请帮我解决这个问题。 在这一行发现多个注释:

  • EL 语法错误

【问题讨论】:

    标签: jstl pagecontext


    【解决方案1】:

    问题是您在测试字符串中嵌入了一些双引号。

    你应该用单引号替换它们。

     <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
     <c:if test="${'POST'.equalsIgnoreCase(pageContext.request.method) && pageContext.request.getParameter('submit') !=null}">
     </c:if>
    

    【讨论】:

    • 不工作,先生。仍然出现错误。“方法 getEqualsIgnoreCase() 未定义 String 类型”。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-11
    • 2014-07-20
    • 2020-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多