[JSTL] fn:contains 포함되는 문자열 찾기

2021. 2. 7. 23:54·Tech Archive/JSTL

fn:contains를 사용하여 포함되는 단어를 찾을 수 있다

boolean contains(java.lang.String, java.lang.String)

fn:contains - 포함되는 문자열이 있으면 true를 반환한다

 

taglib 선언

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

 

fn:contains 예제

<c:set var = "testStr" value = "test string"/>

<c:if test = "${fn:contains(testStr, 'test')}">
	<span>문자열 포함</span>
</c:if>

<c:if test = "${fn:contains(testStr, 'hello')}">
	<span>문자열 미포함</span>
</c:if>

 

'Tech Archive > JSTL' 카테고리의 다른 글

[JSTL] list 길이 구하기(length)  (0) 2021.02.07
[JSTL] parseDate, formatDate 날짜 형식 변경  (0) 2021.02.07
[JSTL] 현재 날짜 구하기 예제  (0) 2021.02.07
[JSTL] JSTL?  (0) 2021.01.13
'Tech Archive/JSTL' 카테고리의 다른 글
  • [JSTL] list 길이 구하기(length)
  • [JSTL] parseDate, formatDate 날짜 형식 변경
  • [JSTL] 현재 날짜 구하기 예제
  • [JSTL] JSTL?
roundfigure
roundfigure
알 수 없는 에러, 기술, 그리고 딱 떨어지는 해답. 사방으로 흩어진 모호한 문제들, 매끄러운 'Round Figure'로 정리하고 싶은 블로그.
  • roundfigure
    Round Figure
    roundfigure
  • 전체
    오늘
    어제
    • 전체 글 (110)
      • Tech Archive (40)
        • Linux (2)
        • Linux(CentOS) (9)
        • Apache (4)
        • SpringBoot (3)
        • React (0)
        • Javascript (8)
        • JSTL (5)
        • 웹접근성 (4)
        • MySQL (2)
        • Unity (0)
        • ETC (3)
      • Trend (17)
      • AI활용 (37)
      • Hosting & Infra (4)
      • Automation & Lab (1)
      • Error & Trouble Shooting (11)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • StackFreeks
    • StackFreeksTools
    • zeuz
    • hydok
  • 공지사항

  • 인기 글

  • 태그

    SWE-bench
    claude code
    Linux
    mysql
    javascript
    Claude Cowork
    Proxy
    JSTL
    jquery
    ai 코딩 도구
    설치
    권한 체크 보안 수정
    apache
    웹접근성
    리눅스
    CursorRules
    클로드 코워크
    CentOS 7
    CLAUDE.md
    프로그래밍
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.6
roundfigure
[JSTL] fn:contains 포함되는 문자열 찾기
상단으로

티스토리툴바