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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scope of a component instance

Status
Not open for further replies.

DomTrix

Programmer
Dec 28, 2004
94
GB
I have a cfc, with some member variables and methods. I create an instance of it in application.cfm cos I need it to be application wide, I declare it like so:

Code:
<cfif not isdefined('request.myObject)>
	<cfobject name="request.myObject" component="components.myObject">
</cfif>

This works fine, the object is instantiated. However, whenever a page is refreshed or a new link in the site is visited, the object seems to be deleted as the above code in application.cfm is called everytime.

I dont want this to happen!

Any ideas?

thanks in advance,

DT
 
Fool noob I am, learned how the request scope and application.cfm worked in the process tho lol.

Making the object a session variable done it.
 
No such thing as a "fool noob". don't be so hard on yourself.

Good luck.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top