JSTL Functions - Prefix "fn"
- Collection Length
- length - String manipulation(문자열 조작 태그)
- toUpperCase, toLowerCase
- substring, substringAfer, substringBefore
- trim, replace, indexOf, startsWith, endsWith
- contains, containsIgnoreCase, split, join, escapeXml - <%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn"%>
- 예제
<%@ page contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<c:set var = "data" value="luv2code"/>
Length of the string <b>${data }</b>: ${fn:length(data)}
<br/><br/>
Uppercase version of the string <b>${data }</b>: ${fn:toUpperCase(data) }
<br/><br/>
Does the string <b>${data}</b> start with <b>luv</b>: ${fn:startsWith(data, "luv")}
</body>
</html>
${fn:함수(var변수 값)}
이런 식으로 사용하면 된다.
'Udemy' 카테고리의 다른 글
JSTL functions (split, join) (0) | 2021.08.07 |
---|---|
JSTL Core Tag -<choose> (0) | 2021.08.07 |
JSTL Core Tag - <if> (0) | 2021.08.07 |
JSTL Core Tag (Looping with forEach) (0) | 2021.08.07 |
JSTL Core Tag-<forEach> 반복문 (0) | 2021.08.07 |