簡體   English   中英

JSTL如果標記始終執行為true

[英]JSTL if tag always execute as true

我正在使用JSTL,並嘗試實現if標簽

以下是我的文件login.tag代碼

<c:if test="${not empty param.error}">
        //do something
</c:if>

我的理解是當我訪問此頁面時

with path/index.jsp   //the if tag is not executed 
with path/index.jsp?error=wrongpassword   //the if tag is executed

但是我現在得到的是if標記始終執行true ,請指教

如果要使用c:if標記,則應對JSTL核心標記庫使用JSP taglib指令。 在JSP頂部使用以下代碼

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

您還需要JSTL庫作為項目的依賴項。 查看答案以查找Maven依賴項。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM