Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnRequestEnd.cfm

Status
Not open for further replies.

noyes99

Programmer
Jun 25, 2002
38
IN
I have a file, and I want to call a custom Onrequest.cfm for this file. But it looks like my program is looking for an OnRequestEnd.cfm in some other directory. How do I call the OnRequestEnd.cfm that I have created? I am pretty new to CFM and hence, I guess I am just asking the basics :)

- n
 
A couple of questions: Are you using an application.cfm? If not, you need to in order for it to look for an onRequestEnd.cfm file.

Also, if you are using the application.cfm file, the onRequestEnd file, I think, needs to be in the same folder as the application.cfm file that you're using. In other words, if you have only one application.cfm file, in the root of your application, that's where onRequestEnd should be.
 
I am using an Application.cfm but thats is in a different directory. I believe it is looking at the OnRequestEnd.cfm in the same directory. I guess I do need to copy that Application.cfm into my directory. What are the basic requirements of an Application.cfm file? ie. What is the bare minimum that is required in an Application.cfm file. I wouldn't want to have anything more than that in there.

thanks for responding.

- n
 
Hmm, is this file that you want to call the custom onRequestEnd for the only file in the directory? Remember, application.cfm will fire for every template in the directory, and the same goes for onRequestEnd (Perhaps there is a way to turn the onRequestEnd off through code, but I'm not sure about that).

As for application.cfm, you can have as little as a comment in the application.cfm file and it will work, but remember that Coldfusion will stop looking up the directory tree for other application.cfm's. So copying the application.cfm file into that directory, assuming it is code that you want to use, would work. Then your onRequestEnd.cfm file should also fire.

hth


 
At the moment, it is the only file in the directory, and even if there are a couple of others, I am pretty sure, this is the one that i am going to use. I was looking at the other Application.cfm that I want to copy, and it appears that the only part i might require is the portion where they are defining certain variables, probably defining the database and initializing other values. So I guess I will be keeping that, and just copying relevant portions into my Application.cfm

Thanks

- n
 
If you are interested in including one file at the end of
your page, (and only that page), you dont really need to use
OnRequestEnd. You could just use cfinclude and include a
template at the end of your page. For example, I have a
footer navigation bar thats inside footer.cfm, but I only want it at the bottom of certain pages, so I do this:

Code:
<CFINCLUDE template=&quot;footer.cfm&quot;>

OnRequestEnd basically just adds whatever code is inside it
to the bottom of every page in the dir (with application.cfm
present, I believe), but if you just want it on one page,
CFINCLUDE will work as well.

MG
 
Ewps, wrong thread. Thats what I get for having multiple
tek-tips browsers open at once. Sorry about that!
 
Ok, disregard my last post... I've got too many windows open,
but it seems I did post to the right thread. ;)

MG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top