| if | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Description | The iftag tests the specified property and includes the
tag body if the property evaluates to true. | |||||||||||||||
| Tag Body | JSP | |||||||||||||||
| Restrictions | If the nameattribute is not specified then uses a parentbeantag to locate the bean on which to operate. Thepropertyspecifies what to test. Thevalueattribute specifies the string value
to test the property; theidattribute specifies the bean object value
to test the property. If neithervalueoridis specified then
the test is true if the property value is non-null. | |||||||||||||||
| Attributes | This tag has the following attributes: 
 | |||||||||||||||
| Properties | None. | |||||||||||||||
| Example(s) | <%-- test if the date time == 0 on parent bean --%> <util:bean type="java.util.Date"> <util:if property="time" value="0"> ... date.time == 0 </util:if> </util:bean> <%-- test if the date time == 0 on named bean --%> <util:bean id="date" type="java.util.Date"/> ... <util:if name="date" property="time" value="0"> ... date.time == 0 </util:if> <%-- test if bean property is non-null --%> <util:bean type="Bean"> <util:if property="name"> ... Bean.name != null </util:if> </util:bean> <%-- test using two beans --%> <util:bean id="one" type="BeanOne"/> <util:bean id="two" type="BeanTwo"/> <util:if name="one" property="bean" id="two"> ... one.bean == two </util:if> | |||||||||||||||