Link to home
Start Free TrialLog in
Avatar of FastEddie___
FastEddie___

asked on

Application and Request Scope Disapearing when accessed from a Coldfusion CFC via CFAjaxProxy

I'm having some strange behaviour in my CFC that is being called via CFAjaxProxy.

I have a page that uses cfajaxproxy to run a sql query.

All the functionallity is correct and it works just fine if I specify the exact datasource name string in the CFC.

The DSN ofcourse should be handled by either #application.myDSN# or #REQUEST.app.myDSN#.

I have tried both the application scope and the request scope but then I get an error message saying:

"myDSN is not defined in Application" and "myDSN is not defiend in REQUEST".

I don't know why it looses these scopes.

Any advice would be greatly appreciated.

Avatar of azadisaryev
azadisaryev
Flag of Hong Kong image

is you cfc in a folder NOT under the folder of Application.cfc/cfm ?
Avatar of FastEddie___
FastEddie___

ASKER

Yes it is Not under the same folder in which application.cfm is located.
It is in a different directory which is still under the webroot in a folder called cfcomponents.
That directory has many other cfc's that use the #application.dsn# variable with no problem.
 
ASKER CERTIFIED SOLUTION
Avatar of azadisaryev
azadisaryev
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes Azadi, you are correct. The other cfc's are not accessed via cfajaxproxy.
Thank you very much for this explaination.
I'm curious about your solution #2. I'm using application.cfm not application.cfc.  
Is it possible to extend the .cfm file or do I have to convert it to a .cfc first?
Thanks.
 
>> Is it possible to extend the .cfm file or do I have to convert it to a .cfc first?

yes, you will have to convert it to Application.cfc in order to be able to extend it.
may be a good idea, since Application.cfc gives you so much more control over your app...

Azadi
Excellent.  Thank you.
-Eddie
Thank you.