Sun Java System Portal Server Mobile Access 7.1 Tag Library Reference

ifnot

Description

This tag tests the specified property and includes the tag body if the property evaluates to false. This is the opposite of the if tag.

Tag Body

JSP

Restrictions

If the name attribute is not specified then uses a parent bean tag to locate the bean on which to operate. The property specifies what to test. The value attribute specifies the string value to test the property; the id attribute specifies the bean object value to test the property. If neither value or id is specified then the test is true if the property value is non-null.

Attributes

This tag has the following attributes for which the Required value are “Yes” and “No”:

name

Name of the bean to use.

property

Name of the property to test.

value

String value of the property to test.

id

Bean object value of the property to test.

Properties

None.

Example(s)
<%-- test if the date time != 0 on parent bean --%>
<util:bean type="java.util.Date">
<util:ifnot property="time" value="0">
... date.time != 0
</util:ifnot>
</util:bean>

<%-- test if the date time != 0 on named bean --%>
<util:bean id="date" type="java.util.Date"/>
...
<util:ifnot name="date" property="time" value="0">
... date.time != 0
</util:ifnot>

<%-- test if bean property is null --%>
<util:bean type="Bean">
<util:ifnot property="name">
... Bean.name == null
</util:ifnot>
</util:bean>

<%-- test using two beans --%>
<util:bean id="one" type="BeanOne"/>
<util:bean id="two" type="BeanTwo"/>
<util:ifnot name="one" property="bean" id="two">
... one.bean != two
</util:ifnot>