站内搜索: 请输入搜索关键词
当前页面: 图书首页 > JavaServer Pages, Second Edition

JavaServer Pages, Second Edition

[ directory ] Previous Section Next Section

8.8 Tags Learned in this Chapter

c:import Imports data from any URL and stores it in a variable
Parameters:
    url: The URL to load
    var: The name of the variable in which the data should be stored
Body: Optional; if present, may be any number of c:param tags, whose values will 
be sent to the named URL

x:parse Transforms an XML document to an internal form that can be used by 
other tags
Parameters:
    xml: An expression specifying where the XML text is stored
    var: The name of the variable in which the resulting internal form should be 
    stored
Body: If no xml parameter is specified, the XML text may be put in the body.

x:out Displays a value
Parameters:
    select: An XPath expression to be evaluated and displayed
Body: Arbitrary JSP code

x:forEach Repeats a section of the page for every item in an array
Parameters:
    items: An expression specifying the array to use, most likely a bean property
    var The name of the variable with which each element in the array will be 
    referred
Body: Arbitrary JSP code

x:if Conditionally includes a portion of the page
Parameters:
    test: An expression that should be a logical test of a property, which may 
    include XPath elements
    var: if present, names a variable in which the result of the expression will be 
    stored
Body: Arbitrary JSP code

x:choose Includes one of several portions of a page
Parameters: None
Body: Arbitrary number of x:when tags and, optionally, one x:otherwise tag; 
nothing else is permitted

x:when One possibility for an x:choose tag
Parameters:
    test: An expression that should be a logical test of a property, which may 
    include XPath elements
Body: Arbitrary JSP code

x:otherwise The catch-all possibility for an x:choose tag. If none of the 
expressions in the when tags evaluate to true, the body of the otherwise will be 
included.
Parameters: None
Body: Arbitrary JSP code

    [ directory ] Previous Section Next Section