DOC

empty

By Chris Morales,2014-10-09 10:20
9 views 0
empty

当指定的值为null, 空字符串, 或者是空的java.util.Collection,或者

    java.util.Map,计算标签题内容

    例子:

    <%

     Person person = new Person();

    person.setName("Toms");

     person.setAge("23");

     request.setAttribute("toms", person);

    %>

    <logic:empty name="toms">

     bean is empty

    </logic:empty>

    <br>

    <logic:empty name="toms" property="name">

     property name is empty

    </logic:empty>

    This tag evaluates its nested body content only if the specified value is either absent (i.e. null), an empty string (i.e. a java.lang.String with a length of zero), or an empty java.util.Collection or java.util.Map (tested by the .isEmpty() method on the respective interface).

    JSTL: The equivalent JSTL tag is <c:if> using the empty operator. For example,

    <c:if test="${empty sessionScope.myBean.myProperty}"> do something </c:if>

    Since: Struts 1.1

    Attribute Description Name

    The variable to be compared is the JSP bean specified by

    this attribute, if property is not specified, or the value

    of the specified property of this bean, if property is name specified.

    [RT Expr]

    The variable to be compared is the property (of the bean property specified by the name attribute) specified by this

    Attribute Description Name

    attribute. The property reference can be simple, nested,

    and/or indexed.

    [RT Expr]

    The bean scope within which to search for the bean named

    by the name property, or "any scope" if not specified. scope

    [RT Expr]

Report this document

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