In order to return a http response code from cfscript use:
getPageContext().getResponse().setStatus( 400 );
In order to return a http response code from cfscript use:
getPageContext().getResponse().setStatus( 400 );
Needed a quick way to check if a key / value pair existed in an array of structures in Coldfusion.
Came up with this little number.
I got tired of having to check if not only the key existed but had a value and so whipped this up. Please share if you’ve a better way to accomplish this.
Here’s a note to self. While referencing a a cgi key will always return true even if the key doesn’t exist, using the java servlet alternatives won’t so here’s a link to their reference. http://cookbooks.adobe.com/post_CGI_Variables_and_their_Respective… Thanks Stephen Withington