DOC

size

By Gloria Boyd,2014-10-09 10:23
9 views 0
size

得到某集合或数组等的大小.

    <%

    java.util.Hashtable table = new java.util.Hashtable();

    table.put("a", "a");

    table.put("b", "a");

    %>

    <bean:size id="size" collection="<%=table%>"/>

    <bean:write name="size"/>

    Given a reference to an array, Collection or Map, creates a new bean, of type java.lang.Integer, whose value is the

    number of elements in that collection. You can specify the collection to be counted in any one of the following ways:

    ; As a runtime expression specified as the value of

    the collection attribute.

    ; As a JSP bean specified by the name attribute.

    ; As the property, specified by the property

    attribute, of the JSP bean specified by the bean

    attribute.

    Attribute Description Name

    A runtime expression that evaluates to an array, a

    Collection, or a Map. collection

    (RT EXPR)

    The name of a page scope JSP bean, of type

    java.lang.Integer, that will be created to contain

    the size of the underlying collection being id counted.

    (REQUIRED) (RT EXPR)

    The name of the JSP bean (optionally constrained

    to the scope specified by the scope attribute)

    name that contains the collection to be counted (if

    property is not specified), or whose property

    getter is called to return the collection to be

counted (if property is specified.

    (RT EXPR)

    The name of the property, of the bean specified by the name attribute, whose getter method will

    property return the collection to be counted.

    (RT EXPR)

    The bean scope within which to search for the JSP bean specified by the name attribute. If not

    specified, the available scopes are searched in scope ascending sequence.

    (RT EXPR)

Report this document

For any questions or suggestions please email
cust-service@docsford.com