Latest web development tutorials

<C : 경우> 태그

JSP 표준 태그 라이브러리 JSP 표준 태그 라이브러리

<C : 경우> 태그 가치 판단의 표현은,이 표현식이 true로 평가되면 그 주요 내용을 실행한다.

구문

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

재산

<C : 경우> 태그는 다음과 같은 특성이 있습니다 :

재산 기술 필요한 경우 디폴트 값
테스트 조건 그것은 인 아니
VAR 조건 변수는 결과를 저장하기 위해 사용 아니 아니
범위 범위 var 애트리뷰트 아니 페이지

데모

<%@ 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>

결과는 다음과 같습니다 :

我的工资为: 4000

JSP 표준 태그 라이브러리 JSP 표준 태그 라이브러리