Retrieves the value of a passed attribute. Returns an empty string if the attribute does not exist (use attributeExists to test whether an attribute was passed to the tag). Use getAttribute(String,String) to return a default value rather than an empty string.
Returns the value of the attribute passed to the tag. If no attribute of that name was passed to the tag, an empty string is returned.
public String getAttribute(String name
)
attributeExists, getAttributeList, getIntAttribute, getAttribute
Parameter |
Description |
---|---|
name |
The attribute to retrieve (case-insensitive) |
The following example retrieves an attribute named DESTINATION and writes its value back to the user:
String strDestination = request.getAttribute("DESTINATION") ; response.write( "The destination is: " + strDestination ) ;