Whatever message this page gives is out now! Go check it out!
public abstract interface Request |
| Returns | Syntax | Description |
boolean | attributeExists(String name) | Checks whether the attribute was passed to this tag. |
boolean | debug () | Checks whether the tag contains the debug attribute. |
String | getAttribute(String name) | Retrieves the value of the passed attribute. |
String | getAttributeList() | Retrieves a list of attributes passed to the tag. |
int | getIntAttribute(String name) | Retrieves the value of the passed attribute as an integer. |
int | getIntAttribute(String name, int def) | Retrieves the value of the passed attribute as an integer (returns default if the attribute does not exist or is not a valid number). |
Query | getQuery() | Retrieves the query that was passed to this tag. |
public boolean attributeExists(String name) |
| Parameter | Description |
name | Name of the attribute to check (case-insensitive) |
if ( ! request.attributeExists("DESTINATION") ) { throw new Exception( "Missing DESTINATION parameter", "You must pass a DESTINATION parameter in " "order for this tag to work correctly." ) ; } ; |
public boolean debug() |
if ( request.debug() ) { response.writeDebug( "debug info" ) ; } |
public String getAttribute(String name) |
| Parameter | Description |
name | The attribute to retrieve (case-insensitive) |
String strDestination = request.getAttribute("DESTINATION") ; response.write( "The destination is: " + strDestination ) ; |
public String[] getAttributeList() |
String[] attribs = request.getAttributeList() ; int nNumAttribs = attribs.length ; for( int i = 0; i < nNumAttribs; i++ ) { String strName = attribs[i] ; String strValue = request.getAttribute( strName ) ; response.write( strName + "=" + strValue + "<BR>" ) ; } |
public int getIntAttribute(String name) |
| Parameter | Description |
name | The attribute to retrieve (case-insensitive) |
int nPort = request.getIntAttribute("PORT") ; if ( nPort != -1 ) response.write( "The port is: " + String.valueOf(nPort) ) ; |
public Query getQuery() |
Query query = request.getQuery() ; if ( query == null ) { throw new Exception( "Missing QUERY parameter. " + "You must pass a QUERY parameter in " "order for this tag to work correctly." ) ; } |
| Parameter | Description |
name | The name of the setting to retrieve (case-insensitive) |
String strVerify = request.getSetting("MyCustomTag.VerifyAddress") ; if ( Boolean.valueOf(strVerify) ) { // Do address verification... } |