Implementing a Java CFX tag requires interaction with the Request
and Response
objects passed to the processRequest
method. In addition, CFX tags that need to work with ColdFusion queries also interface with the Query
object. The com.allaire.cfx
package, located in the WEB-INF/lib/cfx.jar archive, contains the Request
, Response
, and Query
objects.
This section provides an overview of these object types. For a complete description of these object types, see ColdFusion Java CFX Reference in CFML Reference.
For a complete example Java CFX tag that uses Request
, Response
, and Query
objects, see ZipBrowser example.
The Request
object is passed to the processRequest
method of the CustomTag
interface. The following table lists the methods of the Request
object for retrieving attributes, including queries, passed to the tag and for reading global tag settings:
Method | Description |
---|---|
Checks whether the attribute was passed to this tag. |
|
Checks whether the tag contains the |
|
Retrieves the value of the passed attribute. |
|
Retrieves a list of all attributes passed to the tag. |
|
Retrieves the value of the passed attribute as an integer. |
|
Retrieves the query that was passed to this tag, if any. |
|
Retrieves the value of a global custom tag setting. |
For detailed reference information on each of these interfaces, see CFML Reference.
The Response object is passed to the processRequest method of the CustomTag interface. The following table lists the methods of the Response object for writing output, generating queries, and setting variables within the calling page:
Method | Description |
---|---|
Outputs text to the calling page. |
|
Sets a variable in the calling page. |
|
Adds a query to the calling page. |
|
Outputs text to the debug stream. |
For detailed reference information on each of these interfaces, see CFML Reference.
The Query object provides an interface for working with ColdFusion queries. The following table lists the methods of the Query object for retrieving name, row count, and column names and methods for getting and setting data elements:
Method | Description |
---|---|
Retrieves the name of the query. |
|
Retrieves the number of rows in the query. |
|
Retrieves the index of a query column. |
|
Retrieves the names of the query columns. |
|
Retrieves a data element from the query. |
|
Adds a new row to the query. |
|
Sets a data element within the query. |
For detailed reference information on each of these interfaces, see CFML Reference.