Checks whether the attribute was passed to this tag.
Returns True if the attribute is available; otherwise returns False.
public boolean attributeExists(String name
)
getAttribute, getAttributeList
Parameter |
Description |
---|---|
name |
Name of the attribute to check (case-insensitive) |
The following example checks whether the user passed an attribute named DESTINATION to the tag; if not, it throws an exception:
if ( ! request.attributeExists("DESTINATION") ) { throw new Exception( "Missing DESTINATION parameter", "You must pass a DESTINATION parameter in " "order for this tag to work correctly." ) ; } ;