Created
January 3, 2014 14:16
-
-
Save adamcameron/8238504 to your computer and use it in GitHub Desktop.
Code for Railo Group post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Application.cfc | |
component { | |
this.name = "testRest06"; | |
function onApplicationStart(){ | |
writeLog(file=this.name, text="#getFunctionCalledName()#() called"); | |
} | |
function onApplicationEnd(){ | |
writeLog(file=this.name, text="#getFunctionCalledName()#() called"); | |
} | |
function onSessionStart(){ | |
writeLog(file=this.name, text="#getFunctionCalledName()#() called"); | |
} | |
function onSessionEnd(){ | |
writeLog(file=this.name, text="#getFunctionCalledName()#() called"); | |
} | |
function onRequestStart(){ | |
writeLog(file=this.name, text="#getFunctionCalledName()#() called"); | |
} | |
function onRequestEnd(){ | |
writeLog(file=this.name, text="#getFunctionCalledName()#() called"); | |
} | |
function onRequest(){ | |
writeLog(file=this.name, text="#getFunctionCalledName()#() called for #arguments[1]#"); | |
} | |
function onCfcRequest(){ | |
writeLog(file=this.name, text="#getFunctionCalledName()#() called"); | |
} | |
function onError(){ | |
writeLog(file=this.name, text="#getFunctionCalledName()#() called"); | |
throw(object=arguments[1]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test.cfc | |
component restPath="/demo" rest=true { | |
remote string function greet() httpmethod="GET" { | |
return "G'day World @ #now()#"; | |
} | |
remote string function error() httpmethod="GET" restpath="/error" { | |
throw(type="MethodFailedException", message="MethodFailedException was thrown"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment