Cfexecute tag: a few useful notes
Written on 20 October 2011, 04:50pm
Tagged with: cfexecute, coldfusion
Some quick notes about cfexecute tag:
- It is async.
- You cannot put other ColdFusion tags or functions between the start and end tags of cfexecute.
- You cannot nest cfexecute tags.
- In CF8 or less, only stdout output is captured, not stderr. If you need to capture the error, redirect stderr to stdout using 2>&1 – as described here.
- In CF9, you can use errorVariable and errorFile attributes to store (into a variable or file respectively) the result of an error. [#]
- To capture the output, use variable or outputFile attributes. If no outputFile or variable attribute is specified, output is displayed on page from which it was called.
Written by Dorin Moise (Published articles: 277)
- Likes (0)
-
Share
- Comments (1)
Comments (1)
Maybe it’s just me, but I never use the StructNew() syntax to make stcurts.var myStruct = {};myStruct[“key”] = value ;myStruct.foo= bar ;I feel a table is an invalid way to describe a struct. It’s a key-value store and nothing more. It’s equivalent to an Object in Javascript and a HashMap in Java. I bring those two up specifically, because you can JsonSerialize your struct into a json object and the HashMap becuase a coldfusion Struct IS (by inheritance) a Java Hashmap that takes a simple value as a Key and anything as a Value. You can actually call the Java Methods of a HashMap on your struct. Furthermore, this means you get all the nice utility classes from java that take HashMaps as a parameter.NOTE: cfscript is where it’s at.