JSTL 核心标签库 (01) : 概览

核心标签库是最常用的JSTL库.
  1. 安装:
    • 标准语法: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    • XML语法: <anyxmlelement xmlns:c="http://java.sun.com/jsp/jstl/core"/>
  2. 标签概览:
    catch Catches any Throwable that occurs in its body and optionally exposes it.
    choose Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by <when> and <otherwise>
    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
    import Retrieves an absolute or relative URL and exposes its contents to either the page, a String in 'var', or a Reader in 'varReader'.
    forEach The basic iteration tag, accepting many different collection types and supporting subsetting and other functionality
    forTokens Iterates over tokens, separated by the supplied delimeters
    out Like <%= ... >, but for expressions.
    otherwise Subtag of <choose> that follows <when> tags and runs only if all of the prior conditions evaluated to 'false'
    param Adds a parameter to a containing 'import' tag's URL.
    redirect Redirects to a new URL.
    remove Removes a scoped variable (from a particular scope, if specified).
    set Sets the result of an expression evaluation in a 'scope'
    url Creates a URL with optional query parameters.
    when Subtag of <choose> that includes its body if its condition evalutes to 'true'

参考:
http://www.cnblogs.com/lihuiyy/archive/2012/02/24/2366806.html
http://docs.oracle.com/javaee/5/tutorial/doc/bnakc.html
http://docs.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/
http://www.oracle.com/technetwork/java/index-jsp-135995.html

你可能感兴趣的:(jstl)