What is CFInclude?
Cfinclude is like substituting a block of code in the page where you are putting the cfinclude tag. The variables in the called page will have the same scope as in the calling page.
What is CFModule?
Cfmodule is really a custom tag call. It is, in fact, a way to call a custom tag without needing to place it in the "customtags" folder, or in the same folder as the calling process.
What is the difference between Custom tag and Coldfusion Component?
Custom tags have a single entry point; CFCs can have multiple entry points. This makes it possible to create a single component that does many related actions. (To do that with custom tags you'd need multiple tags or cumbersome switch processing.)
Custom tags have no formalized parameter passing and validation mechanism; CFCs do. In other words, unlike custom tags, CFCs can validate passed data, enforce data types, check for required parameters, and optionally assign default values.
Custom tags cannot persist; CFCs can. Custom tags are blocks of code that are executed as is, while CFCs are objects and can be treated as such.
Custom tags are designed to contain code; CFCs are designed to contain both code and data.
Custom tags are accessible only by ColdFusion and only locally; CFCs can be accessed as web services, opening up a whole new world of reuse possibilities.
What is CFX tag? What is the use?
The CFX interface is the original ColdFusion extensibility interface. It is fast and powerful, and allows for tags to be written in Java or in C/C++. CFX tags are executables that must be registered in the ColdFusion Administrator so as to bind an alias with the name of the actual executable. Using the CFX interface, it is possible to write extensions that cannot be written using other interfaces.
What is Coldfusion component?
ColdFusion Components are essential building blocks used in creating tiered, structured, and scalable applications. Unlike Custom Tags, which are primarily used to encapsulate processing, and UI abstractions, ColdFusion Components are designed to black-box processing, transactions, back-end integration, and the like.
How can you invoke CFC?
- <cfinvoke component="user" method="Get" returnvariable="usr">
- <cfinvokeargument name="id" value="#id#">
- <cfobject component="user" name="userObj">
- <cfinvoke component="#userObj#" method="Get" id="#id#" returnvariable="usr">
- // Load CFC as an object
- userObj=CreateObject("component", "user");
- // Invoke method
Method 4: URL Invocation
// Load CFC as an object userObj=CreateObject("component", "user"); // Invoke method user_id=userObj.Get(id);
CFCs can also be invoked on the command line directly; every CFC has a URL that points to it. When invoking CFCs via URLs, the method and any arguments are passed as URL parameters, as seen here:
What are the different ways to access CFC?
Same as above
What is CFobject?
CFC can be instantiated as an object, using the
What is CreateObject?
CreateObject() is a functional equivalent of the
How can you call the external exe files?
using cfexecute tag, we can call the external exe files.Below example executes the Windows NT version of the netstat network monitoring program, and places its output in a file.
arguments = "-e"
outputFile = "C:\Temp\output.txt"
timeout = "1">
What is cfexecute? What are the attributes? What is the drawback of using this?
CFExecute is a tag used to execute developer-specified process on server computer. It has some restrictions like; it cannot run in windows 2003 and cannot run a batch file.
|name||Absolute path of the application to execute. On Windows, you must specify an extension, for example, C:\myapp.exe.|
|arguments||Command-line variables passed to application. If specified as string, it is processed as follows: |
* Windows: passed to process control subsystem for parsing.
* UNIX: tokenized into an array of arguments. The default token separator is a space; you can delimit arguments that have embedded spaces with double-quotation marks.
If passed as array, it is processed as follows:
* Windows: elements are concatenated into a string of tokens, separated by spaces. Passed to process control subsystem for parsing.
* UNIX: elements are copied into an array of exec() arguments.
|outputFile||File to which to direct program output. If no outputfile or variable attribute is specified, output is displayed on the page from which it was called. |
If not an absolute path (starting a with a drive letter and a colon, or a forward or backward slash), it is relative to the ColdFusion temporary directory, which is returned by the GetTempDirectory function.
|timeout||Length of time, in seconds, that ColdFusion waits for output from the spawned program. |
* 0: equivalent to nonblocking mode.
* A very high value: equivalent to blocking mode.
If the value is 0:
* ColdFusion starts a process and returns immediately. ColdFusion may return control to the calling page before any program output displays. To ensure that program output displays, set the value to 2 or higher.
* If the outputFile attribute is not specified, any program output is discarded
|variable||Variable in which to put program output. If no outputfile or variable attribute is specified, output is displayed on page from which it was called.|
What is WDDX? Where all are applicable?
For XML to work, both sender and recipient must agree on an XML language, and all data must be well formed according to that language. WDDX is Macromedia's contribution to the XML community. It is an open-source XML DTD (Document Type Definition) that defines generic data types such as strings, arrays, structures, and recordsets. WDDX is an XML language that defines data not any specific implementation, but raw data itself. This can make data sharing via XML quick and painless (it doesn't require that an XML language be agreed upon).