Simple question - but does anyone know why CFEXECUTE tags must be closed? In other words, you can't do this:
<cfexecute name="parispic" variable="result">
You must either do this:
<cfexecute name="parispic" variable="result" />
Or
<cfexecute name="parispic" variable="result"></cfexecute>
The docs say you that you should not put anything between the closing and end tags, but this is perfectly valid:
<cfexecute name="parispic" variable="result">
<cfset x = 1>
</cfexecute>
But if you try to use X, you get an error. It's almost as if the ColdFusion developers imagined some other tag that would work on the inside - but then changed their mind.
Archived Comments
Maybe they envisioned some kind of argument tag like cfexecuteargument or something like that but regardless it is very strange behavior.
The other thing that has bitten me on CFExecute is the fact that it returns immediately BY DEFAULT. You can have it wait for process completion before returning, and I would expect that to be the default behavior.
If you look at WEB-INF/cftags/META-INF/taglib.cftld you will find that the cfexecute tag is really a JSP custom tag which are normally required to be closed. There are some cases where non-closed JSP cts will not error, but perhaps some extra validation was added for this tag.
Follow-up post: I attached the runtime/cfusion.jar to a java project in Eclipse as an external jar and looked at the method names for coldfusion.tagext.lang.ExecuteTag. There is no public doEndTag() method defined to do something with the tag body. That's why in your example above the "<cfset x = 1>" does nothing.
I don't know about the syntax / closing tags....
But boy is cfexecute picky! It likes to leave processes open indefinitely, and lock files and all sorts of other nasty stuff if the called app doesn't behave just so (like writes to the input stream too much...)