User Guide

Request interface 1085
getIntAttribute
Description
Retrieves the value of the passed attribute as an integer. Returns -1 if the attribute does not exist.
Use
attributeExists to test whether an attribute was passed to the tag. Use
getIntAttribute(String,int) to return a default value rather than throwing an exception or
returning -1.
Returns the value of the attribute passed to the tag. If no attribute of that name was passed to the
tag, -1 is returned.
Category
Request interface
Syntax
public int getIntAttribute(String name)
Throws
NumberFormatException
If the attribute is not a valid number.
See also
attributeExists
, getAttributeList, getIntAttribute
Parameters
Example
The following example retrieves an attribute named PORT and writes its value back to the user:
int nPort = request.getIntAttribute("PORT") ;
if ( nPort != -1 )
response.write( "The port is: " + String.valueOf(nPort) ) ;
getQuery
Description
Retrieves the query that was passed to this tag.
To pass a query to a custom tag, you use the query attribute. It should be set to the name of a
query (created using the
cfquery tag). The query attribute is optional and should be used only by
tags that process an existing dataset.
Returns the Query that was passed to the tag. If no query was passed, returns null.
Category
Request interface
Parameter Description
name The attribute to retrieve (case-insensitive)