티스토리 뷰
Function tags
Function 라이브러리를 상단에 꼭 추가해주도록 하자!
JSTL Core tags도 사용하고 싶으면 그 라이브러리도 꼭 추가해줘야 한다.
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
- fn:contains(): 특정 문자열이 있는지를 검사한다, true/false 값을 리턴한다
- fn:containsIgnoreCase()
- fn:endsWith()
- fn:escapeXml()
- fn:indexOf()
- fn:trim() : 빈칸을 지워주는 역할을 한다
- fn:startsWith()
- fn:split()
- fn:toLowerCase()
참고로 c:out을 굳이 쓰지 않고 ${ } 만으로도 출력할 수 있다
<c:set var="string" value="Welcome to JSP Programming"/>
${fn:toLowerCase("HELLO,")}
${fn:toLowerCase(string)}
- fn:toUpperCase()
- fn:substringBefore()
- fn:length()
- fn:replace()
String fn:replace(String input, String search_for, String replace_with)
Formatting tags
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
- fmt:parseNumber
- fmt:timeZone
- fmt:formatNumber
- type= currency, number, percent
- groupingUsed, maxIntegerDigits, maxFractionDigits, maxIntegerDigits, pattern 등...
- fmt:parseDate
- fmt:bundle : class처럼 사용
- fmt:setTimeZone
- fmt:setBundle
- fmt:message
- fmt:formatDate
XML tags
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
- x:out
- x:parse
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<html>
<head>
<title>XML Tags</title>
</head>
<body>
<h2>Vegetable Information:</h2>
<c:set var="vegetable">
<vegetables>
<vegetable>
<name>onion</name>
<price>40/kg</price>
</vegetable>
<vegetable>
<name>Potato</name>
<price>30/kg</price>
</vegetable>
<vegetable>
<name>Tomato</name>
<price>90/kg</price>
</vegetable>
</vegetables>
</c:set>
<x:parse xml="${vegetable}" var="output"/>
<b>Name of the vegetable is</b>:
<x:out select="$output/vegetables/vegetable[1]/name" /><br>
<b>Price of the Potato is</b>:
<x:out select="$output/vegetables/vegetable[2]/price" />
</body>
</html>
출력 결과:
Vegetable Information:
Name of the vegetable is: onion
Price of the Potato is: 30/kg
- x:set
- x:choose
- x:when
- x:otherwise
- x:if
- x:transform: used in an XML documnet to provide XLS(Extensible Stylesheet Language)
- x:param: used to set the parameter in the XSLT style sheet
SQL tags
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
- sql:setDataSource
- sql:query
- sql:update
- sql:param
- sql:dateParam
- sql:transaction
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- css
- annotation
- DB4free
- HTML_Forms
- HTML #Headings #Paragraph #Styles
- HTML #id #iframe
- links lists tables display
- HTML_Formatting
- HTML #class
- Block_element #inline_element
- UserBean
- javascript #datatype
- box_model
- head #title #style
- HTML #CSS
- html
- jsp
- DynamicWebProject
- meta #link #script #base #HTML
- JSP환경구축
- 2020Camp
- 인용문 #주석
- text_shadow
- fontstyle
- HTML #Tables
- Mavenproject
- HTML #Canvas #SVG
- HTML #media #video #YouTube
- STS4
- JSP_CRUD
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함