Here's the background...
We have all of our requests going through the index.cfm in the root and
depending on variable values, they get directed, via cfincludes, to subfolders.
My question is how do I get the application.cfc in the subfolder to run? The
application.cfc in the root is getting
to get the application.cfc in the subfolder to run, then your original
request would have to be to the subfolder. CF bases which
application.cfc to fire upon the originating request, then travels up
the tree til it finds one (not down, as you are trying to do)
Steve 'Cutter' Blades
Adobe
I would tend to agree that you cannot do it this way because the
application.cfc fires on first request.
If you can use IIS (or Apache) to do your redirect before the application.cfc
fires you should be able to get the ones in the subfolders to fire first, then
do an include at the top of
That is what I was afraid of ;-) Thanks Steve!
-Original Message-
From: Steve 'Cutter' Blades [mailto:cold.fus...@cutterscrossing.com]
Sent: Monday, November 25, 2013 12:34 PM
To: cf-talk
Subject: Re: Application.cfc question
to get the application.cfc in the subfolder to run
Short answer is, its difficult if you want to inherit the methods of the root
folder Application.cfc. Coldfusion allows for one Application.cfc to extend
another, but only if the inherited Application.cfc isnt in the root directory
of the site or has a mapping in the CF Admin ( i.e. -you
:
That is what I was afraid of ;-) Thanks Steve!
-Original Message-
From: Steve 'Cutter' Blades [mailto:cold.fus...@cutterscrossing.com]
Sent: Monday, November 25, 2013 12:34 PM
To: cf-talk
Subject: Re: Application.cfc question
to get the application.cfc in the subfolder to run, then your
If the purpose is code reuse, another possibility might be putting all
logic into templates or other cfc. Then have both application.cfc call the
required functionality through includes or method calls. Somewhat like a
shared library.
Byron Mann
Lead Engineer Architect
HostMySite.com
On Nov 25,
Just curious: can anyone tell a bit more on how exactly Application.cfc is
executed? With normal cfc's I believe that the code above the first method runs
only when a new instance of the cfc is created, or when the cfc is invoked as a
static component. It seems a bit strange to me that the
, application.cfc is the same as application.cfm.
Mike
_
From: Martijn van der Woud [mailto:[EMAIL PROTECTED]
Sent: Mon 11/24/2008 1:31 PM
To: cf-talk
Subject: Re: Application.cfc question
Just curious: can anyone tell a bit more on how exactly Application.cfc is
executed? With normal
A new instance of Application.cfc is created and used on each request,
which is why the code above the first method runs each time.
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/
2008/11/25 Martijn van der Woud [EMAIL PROTECTED]:
Just curious: can anyone tell
Hi - I'm trying to use application.cfc on a new app I'm building and I'm having
a strange occurrence. I'm sure it's just because I'm not as familiar with it
as application.cfm, but I am trying to 'avoid' just switching back to
application.cfm. Here's the issue:
I have the following code.
On Sat, Nov 22, 2008 at 8:38 AM, Dave Phillips wrote:
I have the following code. When I try to execute my URL with the
reloadConfig=yes parameter, The app fails on the first line of the
onSessionStart() function with 'application.datasource does not exist.'
Since onSessionStart is called
I ran into the same problem. I assign datasource in the application.cfm and
then lose the connection string in the cfc. I believe the problem is that a
cfc is intended to run in a different machine as thought it were a web service.
As a result Cold Fusion does not carry the application state
Losers are hammering my site with spam in the urls. The first line is what
my url should look like. The second line is what I am getting from the
spammers.
http://www.mydomain.com/index.cfm?type=Specialtyspec=110
http://www.mydomain.com/index.cfm?type=Specialtyspec=http%3A%2F%2Fwww.north
[mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 8:15 AM
To: CF-Talk
Subject: Application.cfc question: Where would be the best place to put this
code?
Losers are hammering my site with spam in the urls. The first line is what
my url should look like. The second line is what I am getting from
OnRequestStart would seem to be a good place for it. You might also override
the Session timeout (if you're using sessions) so that these spam requests
don't create a large number of dead sessions. You can set the timeout to 5
seconds or something before you do the redirect.
Regards,
Brian
On
Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 9:17 AM
To: CF-Talk
Subject: RE: Application.cfc question: Where would be the best place to put
this code?
That would be the most logical place to put it. I'm not sure that a cfabort
is the best bet though. Why
, June 06, 2008 9:18 AM
To: CF-Talk
Subject: Re: Application.cfc question: Where would be the best place to put
this code?
OnRequestStart would seem to be a good place for it. You might also override
the Session timeout (if you're using sessions) so that these spam requests
don't create a large number
a spammed link to get to your site. Why kill that legit request when
you don't have to?
-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 8:24 AM
To: CF-Talk
Subject: RE: Application.cfc question: Where would be the best place to put
this code
OK. If I were to use a regex, should I still place the code in
onRequestStart and use a re-direct with cflocation?
-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 9:44 AM
To: CF-Talk
Subject: RE: Application.cfc question: Where would
[mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 9:18 AM
To: CF-Talk
Subject: Re: Application.cfc question: Where would be the best place to put
this code?
OnRequestStart would seem to be a good place for it. You might also
override
the Session timeout (if you're using sessions) so
That makes sense to me.
-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 8:54 AM
To: CF-Talk
Subject: RE: Application.cfc question: Where would be the best place to put
this code?
OK. If I were to use a regex, should I still place the code
[mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 9:58 AM
To: CF-Talk
Subject: RE: Application.cfc question: Where would be the best place to put
this code?
That makes sense to me.
-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 8:54 AM
To: CF
Oops. Fixed it. Needed to add urldecode() to my conditional.
-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 10:12 AM
To: CF-Talk
Subject: RE: Application.cfc question: Where would be the best place to put
this code?
OK. This is interesting
I am switching an application.cfm to application.cfc.
Im my application.cfm I defined a function that I used through out the web site.
cfscript
function replaceQuotes(arg) {
return Replace(arg, '', ##34;, ALL);
}
/cfscript
Now in the application.cfc I cannot
Plenty of ways to do this, but I'd probably create a utilities.cfc and then
drop it into the application scope (in OnApplicationStart()). That way,
anytime you want to use it on your site, you just call it that way. The
added benefit is if you find you have more functions liek this that you may
Plenty of ways to do this, but I'd probably create a utilities.cfc and
then
drop it into the application scope (in OnApplicationStart()). That way,
anytime you want to use it on your site, you just call it that way.
I concur with Crow - I was going to suggest exactly the same thing. You
I am having a problem with nesting Application CFCs.
I have an Application.cfc in the root directory with a call to onRequestStart,
and in there I have a variety of variables set in the request scope.
I have another Application.cfc in a sub directory that I built primarily to
handle user
I set it up so that this second Application.cfc extends the root
Application.cfc by using the dot-notation mapping to the root Application -
like extends=SharedSites.Site1.Application. In this file's onRequestStart
function, I try and access the request scope variables set in the parent
I found the super.onRequestStart() function not too long after I sent this.
That fixed that problem, you were correct about it. Thanks, Ian. :)
Now my problem is just making this work correctly! It seems to be ignoring some
IF statements in the child onRequestStart function, and I'm noodling
30 matches
Mail list logo