Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- profile
- JavaScript
- Windows
- netsh
- Eclipse
- ssh
- find
- context
- port
- plugin
- import
- Mac
- GIT
- Quartz
- lsof
- Source
- maVen
- vscode
- 네트워크
- 줄바꿈 문자
- grep
- resource
- IntelliJ
- 단축키
- VirtualBox
- tomcat
- Windows 10
- web.xml
- xargs
- bash
Archives
- Today
- Total
develog
[java] JSTL 본문
JSTL (Java Standard Tag Library)
- Core Tags
- Formatting Tags
- SQL Tags
- XML Tags
- JSTL Functions
Core Tags
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:out>
<c:set>
<c:remove>
<c:catch>
<c:if>
<c:choose>
<c:when>
<c:otherwise>
<c:import>
<c:forEach>
<c:forTokens>
<c:param>
<c:redirect>
<c:url>
Formatting Tags
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:formatNumber>
<fmt:parseNumber>
<fmt:formatDate>
<fmt:parseDate>
<fmt:bundle>
<fmt:setLocale>
<fmt:setBundle>
<fmt:timeZone>
<fmt:setTimeZone>
<fmt:message>
<fmt:requestEncoding>
SQL Tags
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<sql:setDateSource>
<sql:query>
<sql:update>
<sql:param>
<sql:dateParam>
<sql:transaction>
XML Tags
<%@ taglib prefix="x" uri="http://java.sun.com/jps/jstl/xml" %>
<x:out>
<x:parse>
<x:set>
<x:if>
<x:forEach>
<x:choose>
<x:when>
<x:otherwise>
<x:transform>
<x:param>
JSTL Functions
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
fn:contains()
fn:containsIgnoreCase()
fn:endsWith()
fn:escapeXml()
fn:indexOf()
fn:join()
fn:length()
fn:replace()
fn:split()
fn:startsWith()
fn:substring()
fn:substringAfter()
fn:substringBefore()
fn:toLowerCase()
fn:toUpperCase()
fn:trim()
Examples
<!-- c:import -->
<c:import url="/common/top.do">
<c:param name="SHOW_BACK">N</c:param>
</c:import>
<!-- c:if -->
<c:if test = "${salary > 2000}">
</c:if>
<!-- c:forEach -->
<c:forEach items="${userList}" var="item">
<span>${item.userName}</span>
</c:forEach>
<!-- c:choose -->
case1:
<c:choose>
<c:when test="${true && true}">
all true
</c:when>
<c:otherwise>
not all true
</c:otherwise>
</c:choose>
<br>
case2:
<c:choose>
<c:when test="${true || false}">
some true
</c:when>
<c:otherwise>
not some true
</c:otherwise>
</c:choose>
<br>
case3:
<c:choose>
<c:when test="${true && false}">
all true
</c:when>
<c:otherwise>
not all true
</c:otherwise>
</c:choose>
<br>
<!--
case1: all true
case2: some true
case3: not all true
-->
<!-- c:choose -->
<c:set var="age" value="20"/>
case1:
<c:choose>
<c:when test="${age == '20'}">
age is 20
</c:when>
<c:otherwise>
age is not 20
</c:otherwise>
</c:choose>
<br>
case2:
<c:choose>
<c:when test="${age != '20'}">
age is 20
</c:when>
<c:otherwise>
age is not 20
</c:otherwise>
</c:choose>
<br>
<!--
case1: age is 20
case2: age is not 20
-->
http://www.tutorialspoint.com/jsp/jsp_standard_tag_library.htm
'Dev > Java' 카테고리의 다른 글
Spring AOP (0) | 2012.11.24 |
---|---|
[java] JSP (0) | 2012.11.14 |
Primitive Variable (0) | 2012.11.12 |
Primitive Variable, Wrapper Class (0) | 2012.11.12 |
spring version 확인 (0) | 2012.11.08 |
Comments