Cfexecute tag: a few useful notes

Written on 20 October 2011, 04:50pm

Tagged with: ,

Some quick notes about cfexecute tag:

  1. It is async.
  2. You cannot put other ColdFusion tags or functions between the start and end tags of cfexecute.
  3. You cannot nest cfexecute tags.
  4. 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.
  5. In CF9, you can use errorVariable and errorFile attributes to store (into a variable or file respectively) the result of an error. [#]
  6. 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.

Comments (1)

  1. Akimal — August 11, 2015 at 22:26

    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.

    Reply

Leave a response