Home
Username:
Password:
ColdFusion MX 7 Advanced Tutorials

Application Framework / OnApplicationEnd




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

We are going to look at the onapplicaton end method of the Application.cfc file in this movie and onapplication end is triggered when an application times out or the server shuts down. So what we're going to do in this code is create a log file that records the date the application shut down. So what you want to do is open up application end and we're going to copy the code from this file and we're going to put it onto the Application.cfc file and I'm going to put it directly below the onapplication start file. So what I've tried to do for each of these methods is give you some comments in here with regards to information, so if you look back on this Application.cfc file later at the end of the course, you have a lot of information about each of these methods right within the cfc file. So we've set up the onapplication end. Now what we need to do is actually start the application by running a page and then we need to end the application. So I'm just going to use the application Framework page, since we worked with that previously and I will run that page and we looked at the application start already, so that should have triggered the onapplication start. Now what we need to do is go up to our services area and to get to that for ColdFusion, you go to start, settings, control panel and you want to go out to administrative tools and go down to services. If you are not in the classic view in XP, you can always right click the my computer icon, go down to manage and you can get to services that way. That opens up the computer management area and actually I'll show that to you now. We've gone directly to services the last time. But computer management does get you to services down in this lower area and you can just select it on the left-hand side and you can see we get to that same area. So I will stop the ColdFusion server and usually stopping is pretty quick; restarting is usually what takes a while. And as you can see, that stopped the service. We know it stopped because if I refresh, you can see I can't get to the page. So we'll go back to the services area and we will start our ColdFusion and we'll set this up. Now, sometimes this one takes a little while to get it started; a lot longer than it does if we are doing the stopping. So bear with me while we wait for this specific feature. Once it is started again, we will open another page; this application Framework page. I will refresh. That will trigger the application starting. Once in a while, that onapplication end does not show you the log right away. So that should assist with that. But we'll give this just a minute. There we are. I know it started because here is my started and you can always open this up so you can see ok, the application server has started. So let's refresh this page and it should be reworking now thatÉ There we go. Now that ColdFusion is working and let's go to the debugging and logging area and down to the log files and see what our logs look like. You can see I do have a SUMA log here. Application ended, application started, so there's our log file. In type we put information so that's where that comes from. So that is the onapplication end method of the Application.cfc file.

Tutorial Information

Course: ColdFusion MX 7 Advanced
Author: Candyce Mairs
SKU: 33828
ISBN: 1-934743-34-8
Release Date: 2007-11-30
Duration: 6 hrs / 89 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available