본문 바로가기

카테고리 없음

JSTL의 비교연산, EP, NE, EMPTY

JSTL의 비교연산, ep, ne, empty

[의미]

1. eq = equal (==)

2. ne = not equal (!=)

3. empty = list,map등의 객체가 값이 있다,없다를 구분(ex)empty, !empty)

 

[사용예시]

[eq]

 null

  <c:if test="${ null eq columnName }">

 숫자

  <c:if test="${ 0 eq columnName }">

 문자

  <c:if test="${ '0' eq columnName }">

[ne (!=)]

 null

  <c:if test="${ null ne columnName }"> 

 숫자

  <c:if test="${ 0 ne columnName }"> 

 문자

  <c:if test="${ '0' ne columnName }">

[empty]

 객체의 값이 비어있다.

 <c:if test="${ empty  columnMap}">

객체의 값이 있다.

 <c:if test="${ !empty  columnMap}">





[실제 적용 소스]



출처: https://itnewvom.tistory.com/4 [IT's라라♪]