Using ApplicationStop()


show more Using ApplicationStop() provides you with in-depth training on Developer. Taught by Daniel Short as part of the ColdFusion 9 New Features show less
please wait ...

Using ApplicationStop()

If you are like most developers, you've hard coded a URL reset value in your Application.cfc to restart your application when you need to reinitialize everything. This is generally done by calling the onApplicationStart method from your onRequestStart method in Application.cfc. Adobe has added a new function in ColdFusion 9 that will essentially do the same thing. Restarting your application on demand from any page or code in your application. So to show how this works, we are going to open ApplicationStop.cfm in Chapter 2 and all I'm doing here is dumping my application scope, and here I have what is essentially the URL reset that most people put inside their Application.cfc.

So if we have reinit in the URL, I am going to run ApplicationStop and then redirect back to ApplicationStop.cfm. So let's see how this works. I am going to switch to the browser, and just load up my ApplicationStop page. So we'll go to Chapter2/ApplicationStop.cfm. Now here we see our application name...

Using ApplicationStop()
Video duration: 2m 24s 2h 40m Intermediate

Viewers:

Using ApplicationStop() provides you with in-depth training on Developer. Taught by Daniel Short as part of the ColdFusion 9 New Features

Subjects:
Developer Web
Software:
ColdFusion
Author:
please wait ...