Easy automatic debugging
In many web development situations, you are often only allowed to use the automatic ColdFusion debugging in the
test and/or QA environments. With a little additional code, you can use the new
<cf_dump> tag in CF5
to display any and all ColdFusion and CGI variables.
This can aid in both new development and problem identification/resolution since the cfdump tag automatically
displays complex variables (i.e. arrays, structures, etc.)
<!--- determine the values you want to display --->
<cfloop list="FORM,URL,APPLICATION,SESSION,REQUEST,COOKIE,CGI"
index="i">
<h5>
<cfoutput>#i#</cfoutput> VARIABLES
</h5>
<cftry>
<cfswitch expression="#i#">
<cfcase value="session">
<!--- lock the session scoped variables --->
<cflock timeout="10"
type="READONLY"
scope="SESSION">
<cfdump var="#evaluate(i)#">
</cflock>
</cfcase>
<cfcase value="application">
<!--- also should lock the application scoped variables --->
<cflock timeout="10"
type="READONLY"
scope="APPLICATION">
<cfdump var="#evaluate(i)#">
</cflock>
</cfcase>
<cfdefaultcase>
<cfdump var="#evaluate(i)#">
</cfdefaultcase>
</cfswitch>
<cfcatch>
<p>An error occurred while trying to display
<strong><cfoutput>#i#</cfoutput></strong> variables.</p>
</cfcatch>
</cftry>
</cfloop>
You can add this code to your OnRequestEnd.cfm page to always show debugging output. You can also easily extend
this idea to only show the output for certain IP addresses or based on other variables that you set to turn the display on and off.
I have created a custom tag using these principles that allows the output variables to be specified and the display
can be controlled based on a user's IP address. This can be downloaded at http://www.nmconsulting.us/tags/
-
Add a newsfeed to your site
Use the Moreover news service to add a news
feed to your site using cfhttp and wddx in 5 minutes!
Author: Nathan Miller
Views: 25,498
Posted Date: Saturday, July 26, 2003
-
Advanced Server-Side FORM Validation
An advanced set of customizable tags for validating FORM values on the Server-side using User-Defined Functions
Author: Nathan Miller
Views: 22,727
Posted Date: Monday, December 15, 2003
-
Automatically build a FORM using SQL Server system tables
Use SQL server's system tables to automatically create a form to insert data into your database.
Author: Nathan Miller
Views: 28,876
Posted Date: Monday, May 19, 2003
-
ColdFusion Content Injection
Inject customized content into predefined messages by adding specially formatted placeholders in the message.
Author: Nathan Miller
Views: 12,527
Posted Date: Wednesday, March 28, 2007
-
Coldfusion Master Pages
Use ASP.NET-style master pages to replace your header/footer files for web page layout
Author: Nathan Miller
Views: 12,328
Posted Date: Wednesday, August 30, 2006
-
DHTML Tabs (Part 1 of 2)
Visual tab control generator - Creates an interface that loads all the data in each tab in a single page request. This allows the users to click on each tab in the interface and instantly see the data on that tab without waiting for it to load.
Author: Nathan Miller
Views: 12,478
Posted Date: Wednesday, October 26, 2005
-
Dynamically add and remove a 'please wait' message to your complex pages
You can use a combination of and javascript to show a message on the screen
while processing a large data set (or any other long-running task), and then remove the message when the task is complete.
Author: Nathan Miller
Views: 36,176
Posted Date: Tuesday, January 13, 2004
-
Easy automatic debugging
Extend the use of the new tag in CF5
to display any and all ColdFusion and CGI variables.
Author: Nathan Miller
Views: 15,784
Posted Date: Saturday, December 21, 2002
-
Pass complex data in a hidden form field with Base64
Use Base64 to pass html or large blocks of text in a form post without using session variables.
Author: Nathan Miller
Views: 10,905
Posted Date: Friday, March 31, 2006
-
Scope your variables
Increase performace and readability by always scoping your variables
Author: Nathan Miller
Views: 26,876
Posted Date: Monday, May 19, 2003
-
The better way to handle session variables
You can use these simple loops in place of many lines of code to clear out or delete session variables
Author: Nathan Miller
Views: 24,316
Posted Date: Monday, May 19, 2003