일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 윈도우
- HTTP
- Tibero
- String Functions and Operators
- MySQL
- 전자정부 표준프레임워크
- 티베로
- String Functions and Date Operators
- Date and Time Function
- 방화벽
- SVN
- 전자정부표준프레임워크
- Oracle
- 오라클
- String Function and Operators
- Date and Time Functions
- Sring Functions and Operators
- Data and Time Functions
- Today
- Total
웹이야기
JSTL 과 EL 본문
JSTL : JavaServer Pages Standard Tag Library
EL : Expression Language (표현언어)
JSTL은 JSP단에 EL과 함께 쓰여 JSP를 덜 복잡하게(자바코드형태가 많이 쓰이는 것보다) 만들어준다.
JSTL에는 5개 영역(우리가 대부분 쓰는 JSTL은 버전이 1.1일 것이다.)이 있다.
JSTL core
JSTL fmt
JSTL sql
JSTL XML
JSTL functios
1, JSTL core
1
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
cs |
위와 같이 상단에 선언이 되어 있어야 하며, prefix 는 임의로 지정이 가능하지만 대부분의 경우 그냥 사용하는 것 같다.
1) catch
- Catches any Throwable that occurs in its body and optionally exposes it.
2) choose
- Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by <when> and <otherwise>
3) if
- Simple conditional tag, which evalutes its body if the supplied condition is true and optionally exposes a Boolean scripting variable representing the evaluation of this condition
4) import
- Retrieves an absolute or relative URL and exposes its contents to either the page, a String in 'var', or a Reader in 'varReader'.
5) forEach
- The basic iteration tag, accepting many different collection types and supporting subsetting and other functionality
6) forTokens
- Iterates over tokens, separated by the supplied delimeters
7) out
- Like <%= ... >, but for expressions.
8) otherwise
- Subtag of <choose> that follows <when> tags and runs only if all of the prior conditions evaluated to 'false'
9) param
- Adds a parameter to a containing 'import' tag's URL.
10) redirect
- Redirects to a new URL.
11) remove
- Removes a scoped variable (from a particular scope, if specified).
12) set
- Sets the result of an expression evaluation in a 'scope'
13) url
- Creates a URL with optional query parameters.
14) when
- Subtag of <choose> that includes its body if its condition evalutes to 'true'
2. JSTL fmt
- fmt 가 format(또는 formatting)의 약자이지 않을까 추측해본다.
1
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
cs |
위와 같이 상단에 선언이 되어 있어야 하며, prefix 는 임의로 지정이 가능하지만 대부분의 경우 그냥 사용하는 것 같다.
1) requestEncoding
- Sets the request character encoding
2) setLocale
- Stores the given locale in the locale configuration variable
3) timeZone
- Specifies the time zone for any time formatting or parsing actions nested in its body
4) setTimeZone
- Stores the given time zone in the time zone configuration variable
5) bundle
- Loads a resource bundle to be used by its tag body
6) setBundle
- Loads a resource bundle and stores it in the named scoped variable or the bundle configuration variable
7) message
- Maps key to localized message and performs parametric replacement
8) param
- Supplies an argument for parametric replacement to a containing <message> tag
9) formatNumber
- Formats a numeric value as a number, currency, or percentage
10) parseNumber
- Parses the string representation of a number, currency, or percentage
11) formatDate
- Formats a date and/or time using the supplied styles and pattern
12) parseDate
- Parses the string representation of a date and/or time
3. JSTL sql
- sql 관련된 JSTL.
- 한번도 사용해본 적은 없다.
1
|
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
|
cs |
위와 같이 상단에 선언이 되어 있어야 하며, prefix 는 임의로 지정이 가능하지만 대부분의 경우 그냥 사용하는 것 같다.
1) transaction
- Provides nested database action elements with a shared Connection, set up to execute all statements as one transaction.
2) query
- Executes the SQL query defined in its body or through the sql attribute.
3) update
- Executes the SQL update defined in its body or through the sql attribute.
4) param
- Sets a parameter in an SQL statement to the specified value.
5) dateParam
- Sets a parameter in an SQL statement to the specified java.util.Date value.
6) setDataSource
- Creates a simple DataSource suitable only for prototyping.
4. JSTL XML
- XML과 관련된 JSTL.
- 한번도 사용해본 적은 없다.
1
|
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
|
cs |
위와 같이 상단에 선언이 되어 있어야 하며, prefix 는 임의로 지정이 가능하지만 대부분의 경우 그냥 사용하는 것 같다.
1) choose
- Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by <when> and <otherwise>
2) out
- Like <%= ... >, but for XPath expressions.
3) if
- XML conditional tag, which evalutes its body if the supplied XPath expression evalutes to 'true' as a boolean
4) forEach
- XML iteration tag.
5) otherwise
- Subtag of <choose> that follows <when> tags and runs only if all of the prior conditions evaluated to 'false'
6) param
- Adds a parameter to a containing 'transform' tag's Transformer
7) parse
- Parses XML content from 'source' attribute or 'body'
8) set
- Saves the result of an XPath expression evaluation in a 'scope'
9) transform
- Conducts a transformation given a source XML document and an XSLT stylesheet
10) when
- Subtag of <choose> that includes its body if its expression evalutes to 'true'
5. JSTL functios
- 함수(function)모음.
1
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
cs |
위와 같이 상단에 선언이 되어 있어야 하며, prefix 는 임의로 지정이 가능하지만 대부분의 경우 그냥 사용하는 것 같다.
1) contains( java.lang.String, java.lang.String)
- Tests if an input string contains the specified substring.
2) containsIgnoreCase( java.lang.String, java.lang.String)
- Tests if an input string contains the specified substring in a case insensitive way.
3) endsWith( java.lang.String, java.lang.String)
- Tests if an input string ends with the specified suffix.
4) escapeXml( java.lang.String)
- Escapes characters that could be interpreted as XML markup.
5) indexOf( java.lang.String, java.lang.String)
- Returns the index withing a string of the first occurrence of a specified substring.
6) join( java.lang.String[], java.lang.String)
- Joins all elements of an array into a string.
7) length( java.lang.Object)
- Returns the number of items in a collection, or the number of characters in a string.
8) replace( java.lang.String, java.lang.String, java.lang.String)
- Returns a string resulting from replacing in an input string all occurrences of a "before" string into an "after" substring.
9) split( java.lang.String, java.lang.String)
- Splits a string into an array of substrings.
10) startsWith( java.lang.String, java.lang.String)
- Tests if an input string starts with the specified prefix.
11) substring( java.lang.String, int, int)
- Returns a subset of a string.
12) substringAfter( java.lang.String, java.lang.String)
- Returns a subset of a string following a specific substring.
13) substringBefore( java.lang.String, java.lang.String)
- Returns a subset of a string before a specific substring.
14) toLowerCase( java.lang.String)
- Converts all of the characters of a string to lower case.
15) toUpperCase( java.lang.String)
- Converts all of the characters of a string to upper case.
16) trim( java.lang.String)
- Removes white spaces from both ends of a string.
'전자정부표준프레임워크' 카테고리의 다른 글
전자정부표준프레임워크에 Tiles 적용 (0) | 2020.08.19 |
---|---|
전자정부 표준프레임워크 3.9 모바일 공통컴포넌트 설치(템플릿) (0) | 2020.04.15 |
전자정부 표준프레임워크 MySQL 연결 (0) | 2020.03.12 |
globals.properties 의 정보에 대한 암호문 적용 (0) | 2020.03.11 |
globals.properties 의 정보에 대한 암호문 생성 (0) | 2020.03.11 |