Latest web development tutorials

<C: se> tag

Biblioteca JSP Standard Tag Biblioteca JSP Standard Tag

<C: se> espressione giudizio di valore di tag, se l'espressione restituisce true esegue il suo contenuto principale.

sintassi

<c:if test="<boolean>" var="<string>" scope="<string>">
   ...
</c:if>

proprietà

<C: se> tag ha i seguenti attributi:

proprietà descrizione Se necessario difetto
prova condizione è no
var variabili di condizione vengono utilizzati per memorizzare il risultato no no
portata attributo var Scope no pagina

la dimostrazione

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>c:if 标签实例</title>
</head>
<body>
<c:set var="salary" scope="session" value="${2000*2}"/>
<c:if test="${salary > 2000}">
   <p>我的工资为: <c:out value="${salary}"/><p>
</c:if>
</body>
</html>

I risultati sono i seguenti:

我的工资为: 4000

Biblioteca JSP Standard Tag Biblioteca JSP Standard Tag