Description
Intercepts any HTTP or AMF calls to an application based on CFC request.
Syntax
<cffunction name="oncfcRequest" returnType="void"> |
See also
Method summary, Handling errors in Application.cfc in Defining the application and its event handlers in Application.cfc in the Developing ColdFusion Applications
Parameters
ColdFusion passes the following parameters to the method:
Parameter |
Description |
---|---|
cfcname |
Fully qualified dotted path to the CFC. |
method |
The name of the method invoked. |
args |
The arguments (struct) with which the method is invoked. |
Usage
Whereas onRequest handles only requests made to ColdFusion templates, this function controls Ajax, Web Service, and Flash Remoting requests.
Example
Create a folder onCFCRequest in your web root. Place test.cfc and Application.cfc in this directory and make an HTTP call to the CFC using the following URL:http://localhost:8500/onCFCRequest/test.cfc?method=foo&arg1=1&arg2=2&arg3=3When you run the URL, the method onCFCRequest is called and the function name foo is passed along with the arguments arg1, arg2, and arg3.You can then invoke the test.cfc as shown in the following example:
<!--- Application.cfc ---> |