Is onRequestEnd.cfm mandatory ?

Is onRequestEnd.cfm mandatory if Application.cfm is defined?

Nope... it is optional.  However, you should be using Application.cfc
Application.cfc | Learn CF in a Week

Similar Messages

  • OnRequestEnd.cfm problem

    I created a page in the test directory which is under the
    wwwroot directory. When I rename the file to something else in
    order to avoid being found by CF, then I get an error "File not
    found: C:\ColdFusion8\wwwroot\test\OnRequestEnd.cfm".
    This behaviour is seen only on some pages not all and I am
    not able to see any pattern among the pages where this problem is
    seen. When I restart the server, the problem is solved and all
    pages are rendered properly. As soon as i create the file, issue a
    request and then rename the file to something else, the problem
    resurfaces.
    Can anyone throw more light on this?

    I had that problem, too. It is easy to reproduce.
    Put Application.cfm, OnRequestEnd.cfm and a number of CFM
    pages, say, p1.cfm, p2.cfm and p3.cfm in a directory. Run the pages
    p1.cfm and p2.cfm. Rename the file OnRequestEnd.cfm to
    OnRequestEnd2.cfm.
    If you now rerun p1.cfm and p2.cfm, you will get the File Not
    Found error. However, p3.cfm will run without error. It is clear
    what is happening. The pages that you ran earlier when
    OnRequestEnd.cfm was present are the ones that give an error when
    OnRequestEnd.cfm is absent.
    OnRequestEnd.cfm is just an included page. You can therefore
    reproduce the problem with any included page, if you follow the
    same steps.
    I think it happens because Coldfusion caches the pages it has
    run, together with any includes like OnRequestEnd.cfm that the
    pages may contain. When a page is subsequently requested,
    Coldfusion will, for efficiency, simply recycle the cached copy of
    the page when it detects that there has been no change to its
    content. Hence the continued File Not Found error.
    So, in your case, one obvious way to avoid the error is to
    perform some dummy action to the page, like adding a space, and
    re-saving the file. A second way out is to clear the template cache
    in the Coldfusion Administrator. (Both methods assume that you have
    unchecked the
    Trusted cache setting in the Administrator).

  • Trying to understand an application.cfm attack

    I have a site that I've been running without issue, for years now - I sniff and block for cross site scripting, sql injection, executable file uploads, and employ honeypot fields on forms... 
    This past week I wanted to watch some slow page loads for performance, noting their time to execute.  I chose to use an application.cfm and an onrequestend.cfm to set a timestamp and to place it on the end of my pages.  Prior to this, I have not utilzed an application.cfm.  I'm pragmattic and look upon the application.cfm as a catch-all to do things that I should be planning better for in my application.
    I soon found myself the recipient of a cross site scripting attack.  I realised easily that I opened myself wide to this because the application.cfm runs _before_ everything, including my sniffer code. Derrrr!
    I deleted the application.cfm and onrequestend.cfm and cleanded up my files having caught it same day and experiencing little damage.  The attack was only inserting javascript into my index pages via the application.cfm .  Rather ingenious and it was fun to find and consider.  Payday loan spam.
    I've been google'ing and reading on uploading vulnerabilities, but I can only find one instance where someone described their application.cfm file having been modified in similar fashion, the vector being a vulnerability in fckeditor - which I do not use. Nor do I use any other third party editor plugin.
    An article I found mentions vulnerable files in legacy CFDOCS folder that allow access and uploads.  I have a fresh install of CF9 so this did not exist.  There was a cfx folder tree with some "example" code folders.  I've zipped and deleted these.
    I have changed ftp to use a non-standard port.  Something that I used to do, but failed to re-instate when I moved to a different host.  I have a ticket submitted to get help in blocking CFIDE path requests to the outside world (so that it will only be accessable locally via RDP).
    If someone/something could modify the application.cfm file, why look for just it, unless it was just a lazy scripted attack looking for application.cfm files specifically.  And while I did not have one before, why did someone not just upload their own?
    How and why was my application.cfm changed, and why not the index.cfm files directly if they had some other avenue of access?
    My question is this - can the application.cfm be tricked into modifying itself?
    Thanks in advance!

    Sorry about that - a misunderstanding. When you said you "deleted the application.cfm and onrequestend.cfm and cleanded up my files...", I took that to mean you only deleted the code. I assumed the files to still be on the file system. For, to run a ColdFusion application of any substance, you do need an Application file.
    aotgnat wrote:
    The attack was only inserting javascript into my index pages via the application.cfm .
    Not necessarily via the application file. What the attacker may very likely have exploited is a ColdFusion Cross Site Scripting (XSS) vulnerability. This link shows you that a cfform, user-agent HTTP header, etc. may be used in an XSS attack. (See the XSS vulnerabilities relevant to CF9, which include CVE-2009-3467, CVE-2010-1293, CVE-2011-0583, CVE-2011-0733, CVE-2011-0734, CVE-2011-0735, CVE-2011-2463, CVE-2011-4368).

  • Protecting Application.cfm

    What security measures can we take to protect the
    Application.cfm file. We usually keep database login and password
    info obviously and other password info. Is there really nothing
    else to do except knowing that no one should access the actual
    file? thanks!

    quote:
    Originally posted by:
    Dan Bracuk
    Why do you have database login information and other
    passwords there?
    Well, the login and password must be in the <cfquery>
    tag on any given page that queries the db. We just put it in a
    application variable instead of on every single database driven
    page.
    We do the same for <cfmail> you need to put the email
    and the password in the tag so we use application variables instead
    to make changes more efficient.
    When you try accessing application.cfm from the browser you
    get:
    nvalid request of Application.cfm, Application.cfc or
    OnRequestEnd.cfm file.
    You have requested a page with the name application.cfm. This
    file name is reserved by the ColdFusion engine for the
    specification of application level settings and therefore cannot be
    directly requested from a web client.

  • HOW TO KEEP TEXT AT BOTTOM OF PAGE USING JAVASCRIPT-ANSWERED

    UPDATE 5/12/2006: MORE COMPATIBLE CODE:
    Was using OnRequestEnd.cfm to load copyright info at bottom
    of each page but page size varied and copyright info would appear
    at different points on different pages. Didn't look good. Could not
    use tables to align the text for output reasons. Coded a way using
    CSS and JavaScript to keep text at bottom of each page. Be careful
    with CFFORM, us have to set the attribute 'wMode=transparent' in
    CFFORM so text is above form. Tested in IE and Netscape. Put at end
    of individual templates or inside OnRequestEnd.cfm - Enjoy!
    (css goes in your external css file or between local style
    tags)
    .copyright{background-color:#d8d8d8;color:Black;font-size:10px;font-family:Arial;width:10 0%;text-align:center;}
    body {border-bottom-width:0px;}
    (following goes at end of page or in OnRequestEnd.cfm)
    <span id="x" class="copyright">
    my copyright
    </span>
    <!--- *** KEEPS COPYRIGHT LINE AT ABSOLUTE BOTTOM OF EACH
    PAGE --->
    <script>
    if(document.body.scrollHeight <
    document.body.clientHeight){
    var s = 0;
    document.getElementById('x').style.cssText='position:absolute;bottom:'+s+';';
    else {
    var s = document.body.scrollHeight;
    document.getElementById('x').style.cssText='position:absolute;top:'+s+';';
    </script>

    To change it for a given text frame, the frame must be selected when you execute the menu command.
    AlyMcF1 wrote:
    …how can I apply this to the majority (400+) of my text frames at once?
    To change the setting of existing frames throughout your document, use Edit > Find/Change.
    Choose the Object tab.
    Set the Search: field to Document.
    Set the Type: field to Text Frames.
    If there is a formatting attribute common to all the text frames you want to target and change, click the glass/frame icon next to the Find Object Format field to access the Find Object Format Options dialog and set that common attribute.
    Click the glass/frame icon next to the Change Object Format field to access the Change Object Format Options dialog and set the Align: field to Justify under Basic Attributes > Text Frame General Options > Vertical Justification.
    Step through the Find Next/Change sequence to selectively apply the change, or click the Change All button if you're certain you want all the found frames changed.

  • Using a single  file as a template for th whole site

    My Application.cfm file has the code that i am using as a
    template for the rest of my site. On the template, the title
    section looks like this. <cfif
    IsDefined('pagetitle')><cfoutput><title>#pagetitle#</title></cfoutput><else><title>Welcom e</title>
    and the title variable is set on the end page. lets just say
    test.cfm but when i view test.cfm the title is always Welcome. How
    can i fix this. and this also goes along with my content. On the
    application.cfm pge i have empty divs. on the test.cfm page i have
    the same divs only with all the page-relevant information in them,
    but they never show up. I know that this is how you do it in php.
    but how do you do it in ColdFusion

    Theres a few things you could do here... none of which I
    think is the perfect solution. It all depends on your preference as
    well as the needs of your application.
    -- Move your page title code to another file - call it
    Header.cfm or something along those lines -- and include it in
    every page after you set the pagetitle variable.
    -- Use Javascript to add the page title to some div at the
    top of the page when it loads. (not my favorite option here)
    -- Check out the CF tag cfsavecontent. You could save the
    generated HTML in test.cfm into a variable and output it later. Put
    your pagetitle code in OnRequestEnd.cfm, which is called AFTER
    every template is executed. Set your pagetitle variable in test.cfm
    and save the HTML into a variable, then in OnRequestEnd.cfm output
    the pagetitle followed by your generated content.

  • How to get the page call stack

    Is there any way to get a list of files used in building a
    single page? What I need is to be able to see what page called the
    custom tag from within that custom tag. Using getBaseTemplatePath
    doesn't work because it only shows the top level page, not the
    actual file that called the custom tag. Take the following
    structure for instance:
    /webroot/mydir/myfile.cfm
    /webroot/mydir/myincludes/includefile.cfm
    /webroot/customtags/thecustomtag.cfm
    If myfile.cfm cfincludes includedfile.cfm and then
    includefile.cfm calls thecustomtag.cfm, thecustomtag.cfm thinks
    myfile.cfm called it. Which is wrong, and a bit stupid.
    I've tried the back door method:
    <cfset objFactory = CreateObject( "java",
    "coldfusion.server.ServiceFactory" ) />
    <cfset objDebugging = objFactory.GetDebuggingService()
    />
    <cfset qEvents = objDebugging.GetDebugger().GetData()
    />
    <cfdump var="#qEvents#">
    But found out later that this only works with debugging
    turned on in CF admin AND no IP restrictions are set (unless the
    IPs for the clients are listed there).
    This should be a very simple task, one would think. Any
    suggestions?

    We CFInclude the following snippet into all project files
    when this functionality is needed:
    <CFScript>
    // Init Template Management
    myName = getFileFromPath(getCurrentTemplatePath());
    if(NOT isDefined('TemplateManagement')){
    TemplateManagement = structNew();
    TemplateManagement.cnt = 0;
    else{
    TemplateManagement.cnt = TemplateManagement.cnt + 1;
    if(NOT structKeyExists(TemplateManagement, myName)){
    TemplateManagement[myName] = structNew();
    // Versioning:
    TemplateManagement[myName].App.Version.Major = 1;
    TemplateManagement[myName].App.Version.Minor = 1;
    // License:
    TemplateManagement[myName].License.SerialNumber = '';
    TemplateManagement[myName].License.Owner = '';
    </CFScript>
    ...at the end of the http request, usually in
    onRequestEnd.cfm, you can grab the 'TemplateManagement' struct and
    take a look.

  • How do I save and manipulate an attached document through gmail?

    How do I save and manipulate an attached document through gmail on my iPhone?

    I had a client that had hundreds of session variables
    scattered in hundreds of CF pages. There was very little CFLOCKing,
    and consequently the apps were quite unstable in a loaded
    environment.
    What I finally did was to copy the session scope variables to
    ses.request scope variables of the same name, then did a global
    replace of session. with ses.request. In OnRequestEnd.cfm, and
    immediately before all CFLOCATIONs, I copied ths ses.request scope
    back to session scope (locked, of course). There was no measurable
    performance hit, and the apps were rock solid.
    Perhaps you could copy your client variables to session
    scope; then back again in OnRequestEnd.cfm

  • How do I save and restore Session?

    Is it possible to have a user leave the site for a period of
    time, say 2 or 3 days, and when they come back, restore their last
    session and all the session variables? I have an idea of building a
    database and writing them all to the db on each page load with the
    last visited page, and then resetting from that on their next
    visit, but is there an easier way through Cold Fusion that I'm not
    aware of? Any assistance is apprecaited.

    I had a client that had hundreds of session variables
    scattered in hundreds of CF pages. There was very little CFLOCKing,
    and consequently the apps were quite unstable in a loaded
    environment.
    What I finally did was to copy the session scope variables to
    ses.request scope variables of the same name, then did a global
    replace of session. with ses.request. In OnRequestEnd.cfm, and
    immediately before all CFLOCATIONs, I copied ths ses.request scope
    back to session scope (locked, of course). There was no measurable
    performance hit, and the apps were rock solid.
    Perhaps you could copy your client variables to session
    scope; then back again in OnRequestEnd.cfm

  • Trouble using cfincludes with multi-folder structure

    We are rebuilding our site using <cfinclude> to pull in
    standard headers and footers for each page. The headers and footers
    each have many links in them. How can we deal with the fact that
    the pages calling the cfincludes are not all at the same level in
    the folder structure? How can we create one include file for the
    header and one include file for the footer that can each be used
    throughout the site regardless of the level in which the calling
    page is located? Thank you.
    Cheers!
    James

    How can we create one include file for the header and one
    include file for the footer that can each be used throughout the
    site regardless of the level in which the calling page is
    located?
    Create the one header.cfm and the one footer.cfm. Include
    them in Application.cfm/OnRequestEnd.cfm or in Application.cfc.

  • Get loggedin Session variables in Home Page

    I got a members directory where u login.
    1.How come they get killed when i refresh a page.
    2.How do i get the loggedin session variable the home page.
    so i know if current user is logged in.
    The Application.cfc of the members is
    <cfcomponent name="Application" displayname="Application
    Component for the Login Security Tutorial" >
    <cfset This.name = "NewLoveZoneAfrica">
    <cfset This.applicationTimeout =
    CreateTimeSpan(0,0,0,45)>
    <cfset This.sessionManagement = "true">
    <cfset This.sessionTimeout = CreateTimeSpan(0,0,0,30)>
    <cfset This.clientManagement = "false">
    <cfset This.loginstorage="session">
    <cffunction name="onApplicationStart"
    returntype="boolean" output="true">
    <!--- Set up Application variables. Locking the
    Application scope is not necessary in this method. --->
    application starting
    <cfset Application.configured = 1>
    <cfset Application.datetimeConfigured = TimeFormat(Now(),
    "hh:mm tt") & " " & DateFormat(Now(), "mm.dd.yyyy")>
    <cfset Application.currentSessions = 0>
    <!--- Begin Setting up request variables here. --->
    <cfscript>
    request.app = structNew();
    Application.dsn = "LoveZoneAfrica";
    Application.webRoot =
    "#getPageContext().getRequest().getContextPath()#/NewLoveZoneAfrica/";
    Application.machineRoot = "/NewLoveZoneAfrica/";
    Application.cfcRoot = "NewLoveZoneAfrica.com";
    Application.Domain = "NewLoveZoneAfrica.com";
    factory=CreateObject("java","coldfusion.server.ServiceFactory");
    sqlService = factory.getDataSourceService();
    dsn = duplicate(sqlService.datasources[Application.dsn]);
    if(dsn.driver eq "MSAccess" or dsn.driver eq "MSAccessJet"
    or dsn.driver eq "ODBCSocket")
    request.app.ucase = "ucase";
    request.app.isAccess = true;
    else
    request.app.ucase = "ucase";
    request.app.isAccess = false;
    </cfscript>
    <!--- End Setting up request variables here. --->
    <cfreturn true>
    </cffunction>
    <cffunction name="onRequestStart" returntype="boolean"
    output="true" >
    <cfargument name="requestname" required=true/>
    <cfif isDefined("form.j_username") and
    isDefined("form.j_password")>
    <!--- If either password or Username is empty go to
    login--->
    <cfif form.j_username is "" or form.j_password is "">
    <cfinclude
    template="#Application.webRoot#Login/Security/Login.cfm">
    <cfabort>
    </cfif>
    <!--- First Check to see wether there is need to log out
    user--->
    <cfscript>
    // create the Security object
    Security =
    createObject("component","#Application.cfcRoot#.security");
    // store authenticate method of security object as roles
    variable.
    LogQry=Security.authenticate(form.j_username,form.j_password);
    </cfscript>
    <cfif LogQry.recordcount> <!--- User has
    Successfully logged in #GetValidUser# --->
    <cfloginuser name="#form.j_username#"
    password="#form.j_password#" roles="#valuelist(LogQry.Role)#">
    <!--- Update the LastLogin timestamp. --->
    <cfscript>Update_LastLogin=Security.LastLogin(form.j_username);
    </cfscript>
    <cfset request.User.LoggedIn = "1">
    <cfset request.User.Username = form.j_username>
    <cfset request.User.LastLogin = LogQry.LastLogin_Date
    >
    <cfelse>
    <!---Destroy request --->
    <cflock scope="SESSION" throwontimeout="Yes" timeout="7"
    type="EXCLUSIVE">
    <cfset clearStruct = StructDelete(request, "User")>
    </cflock>
    <!---Destroy request --->
    <cflock scope="SESSION" throwontimeout="Yes" timeout="7"
    type="EXCLUSIVE">
    <cfset clearStruct = StructDelete(SESSION, "User")>
    </cflock>
    </cfif>
    <cfif NOT isDefined("request.User.LoggedIn")>
    <cfset request.loginMessage ="Your Login Username or
    Password is Invalid ">
    <cfinclude
    template="#Application.webRoot#Login/Security/Login.cfm">
    <cfabort>
    <cfelse>
    <!--- If the login procedure is passed duplicate the
    request structure into the Session scope. --->
    <cflock scope="SESSION" throwontimeout="Yes"
    timeout="107" type="EXCLUSIVE">
    <cfset Session.User = Duplicate(request.User)>
    </cflock>
    <cflock name="lck_currentSessions" throwontimeout="Yes"
    timeout="107" type="EXCLUSIVE">
    <!---THIS has BE CHANgED : bEGIN- original COPY IS @ THE
    FOOT --->
    <!--- Copy identifying session information into the
    Application scope. --->
    <cfif NOT isDefined("Application.sessionData")>
    <!--- Increment the number of current sessions. --->
    <cfset Application.currentSessions =
    Application.currentSessions + 1>
    <cfset Application.sessionData = ArrayNew(1)>
    <cfset Arraysize = 0>
    <cfset Application.sessionData[Arraysize+1] =
    form.j_username>
    <CFELSE>
    <!---check to see wether this "Username" appears in the
    Application.sessionData.
    If so, ignore. If no then append the name to the array so we
    have a unique list of usernames--->
    <cfset Arraysize = ArrayLen(Application.sessionData)>
    <cfset Application.temp = ArrayNew(1)>
    <cfif Arraysize>
    <cfloop index = "LoopCount" from = "1" to =
    "#Arraysize#">
    <cfset #ArrayAppend(Application.temp,
    Application.sessionData[LoopCount])#>
    </cfloop>
    <cfdump var="#Application.sessionData#" >
    <cfset Isloggedin =
    ListFind(ArrayToList(Application.temp), form.j_username)>
    <cfif Isloggedin is 0>
    <cfset Application.sessionData[Arraysize+1] =
    form.j_username>
    <!--- Increment the number of current sessions. --->
    <cfset Application.currentSessions =
    Application.currentSessions + 1>
    </cfif>
    <cfelse>
    <!--- Increment the number of current sessions since twas
    empty. --->
    <cfset Application.currentSessions =
    Application.currentSessions + 1>
    <cfset Application.sessionData[Arraysize+1] =
    form.j_username>
    </cfif>
    </cfif>
    </cflock>
    </cfif>
    <cfelse>
    <cfif not ListLast(CGI.SCRIPT_NAME, "/") EQ
    "logout.cfm">
    <!---Check wether the username appears on the list
    Application.currentSessions is 0 --->
    <cfif NOT isDefined("Session.User.LoggedIn") >
    <cfinclude
    template="#Application.webRoot#Login/Security/login.cfm">
    <cfabort>
    </cfif>
    </cfif>
    </cfif>
    <!--- Check to see if a user is logged in on *every* cfm
    page request. --->
    <cfif not ListLast(CGI.SCRIPT_NAME, "/") EQ
    "logout.cfm">
    <cflock scope="SESSION" throwontimeout="Yes" timeout="7"
    type="READONLY">
    <cfif NOT isDefined("Session.User.LoggedIn")>
    <cfinclude
    template="#Application.webRoot#Login/Security/login.cfm">
    <cfabort>
    </cfif>
    </cflock>
    </cfif>
    <cfreturn true>
    </cffunction>
    <cffunction name="onSessionEnd" returntype="void">
    <cfargument name="SessionScope" required="true">
    <cfargument name="ApplicationScope" required="true">
    <cfset request.loginMessage="Nimeingia onSessionEnd">
    <cflock name="lck_currentSessions" throwontimeout="Yes"
    timeout="7" type="EXCLUSIVE">
    <cfset sessionPosition =
    ListFind(ArrayToList(arguments.ApplicationScope.sessionData),
    arguments.SessionScope.sessionid)>
    <cfif sessionPosition neq 0>
    <cfset
    ArrayDeleteAt(arguments.ApplicationScope.sessionData,
    sessionPosition)>
    <cfset arguments.ApplicationScope.currentSessions =
    arguments.ApplicationScope.currentSessions - 1>
    </cfif>
    </cflock>
    </cffunction>
    <cffunction name="onSessionStart" returntype="void">
    <cfset request.loginMessage="Nimeingia onSessionEnd">
    </cffunction>
    <cffunction name="onRequestEnd" returntype="void">
    <!--- Write any code that needs to run when the page
    request ends. This replaces onRequestEnd.cfm --->
    </cffunction>
    </cfcomponent>

    Answered my own quests
    http://www.rewindlife.com/archives/000046.cfm

  • How can we get debug info without adding IP in CFServer?

    Do we have tag or some code which will give debug
    information?.
    <cfdump var="#http#"> on onrequestend.cfm will give me
    http varible information....any other way?.

    Do you have debug settings turned on in CF administrator?
    This tag can be used in conjunction: <cfsetting
    enableCFoutputOnly = "yes" or "no"
    showDebugOutput = "yes" or "no"
    requestTimeOut = "value in seconds" >

  • Other language enhancements

    This question was posted in response to the following article: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSe9cbe5cf462523a0-5d0bd438122084e17 59-7ffe.html

    There seems to have been a change to the Application.cfc OnRequestEnd method that I can't find documented anywhere. In previous versions of CF, page execution ended completely and immediately after executing a CFABORT or CFLOCATION tag. In ColdFusion 9 this appears to have changed to now executing the onRequestEnd event before terminating the request (only if it's in the Application.cfc, not if it's an OnRequestEnd.cfm template). I'll post this comment also on the OnRequestEnd page. More from Ben Nadel: http://www.bennadel.com/blog/2050-Changes-In-CFLocation-OnRequestEnd-Behavior-In-ColdFusio n-9-s-Application-cfc.htm and from my blog: http://ontap.riaforge.org/blog/index.cfm?mode=entry&entry=58993158-CFC0-A2D4-EB631D225F064 EDD

  • Components and virtual directories.

    CF8hf3, W2K3, IIS.
    Site1\application.cfc (-> this.name = "site1";)
    Site1\Components\MyComponent.cfm
    Site1\UseComponentToShowSiteNameOnSite1.cfm
    Site2\application.cfc (-> this.name = "site2";)
    Site2\Components ... this is an IIS virtual directory that
    points to Site1\Components
    Site2\UseComponentToShowSiteNameOnSite2.cfm
    Problem #1
    Create this cfc and place it in \Site1\Components. The
    virtual directory makes it available to site2 as well. The website
    root for the site containing the virtual directory has a different
    application.cfc than the website that has this test component in
    it's physical structure.
    <cfcomponent displayname="test component">
    <cffunction name="TestFunction" output="No"
    returntype="string" access="remote">
    <cfreturn application.applicationname>
    </cffunction>
    </cfcomponent>
    If this component is called directly:
    http://site2/Components/test.cfc?method=testfunction
    it returns the applicationname for site1, however, when used
    like so:
    <cfoutput>
    #createobject("Component",
    "site2.Components.Test").TestFunction()#
    </cfoutput>
    it returns site2.
    Problem #2
    A CFGrid tag on site2 with this bind attribute:
    bind="cfc:site2.Components.Test.TestFunction({cfgridpage}...
    generates this js in the rendered page:
    ColdFusion.Bind.cfcBindHandler(<snip>...
    :_cf_grid_errorhandler,'cfc':'/site1/Components/test.cfc','cfcFunction':'TestFunction'
    ...<snip>
    On both occasions it appears the cf server traverses the
    physical path and uses that to resolve Application.cfc which is
    different behavior than any other processed file.
    Thanks!
    Mischa.

    MU wrote:
    > On both occasions it appears the cf server traverses the
    physical path and
    > uses that to resolve Application.cfc which is different
    behavior than any other
    > processed file.
    Yep, exactly as it explains it will in the documentation on
    Application.cfm and Application.cfc files. CF looks for these
    in the
    physical path, not the virtural path of the directory.
    This is a big reason most CF developers will tout that a
    component
    should only know what is passed to it is arguments. Expecting
    it to
    'know' something such as what application it is in, or what
    is in the
    session scope and such will experience problems just like
    this.
    Want to see what a bigger headache this could be. Set some
    session data
    in each site1 and site2 that is different and then check the
    results
    with the same kind of testing.
    <quote from="CF Documentation">
    *How ColdFusion MX finds and process application definition
    pages*
    ColdFusion MX uses the following rules to locate and process
    the
    Application.cfc, Application.cfm, and OnRequestEnd.cfm pages
    that define
    application-specific elements. The way ColdFusion MX locates
    these files
    helps determine how you structure an application.
    Each time ColdFusion MX processes a page request it does the
    following:
    When ColdFusion starts processing the request, it does the
    following:
    It searches the page’s directory for a file named
    Application.cfc. If
    one exists, it creates a new instance of the CFC, processes
    the initial
    events, and stops searching. (ColdFusion MX creates a new
    instance of
    the CFC and processes its initialization code for each
    request.)
    If the requested page’s directory does not have an
    Application.cfc file,
    it checks the directory for an Application.cfm file. If one
    exists,
    ColdFusion MX logically includes the Application.cfm page at
    the
    beginning of the requested page and stops searching further.
    If the requested page’s directory does not have an
    Application.cfc or
    Application.cfm file, *ColdFusion MX searches up the
    directory tree and
    checks each directory first for an Application.cfc file and
    then, if one
    is not found, for an Application.cfm page, until it reaches
    the root
    directory (such as C:\).* When it finds an Application.cfc or
    Application.cfm file, it processes the page and stops
    searching.
    </quote>
    Note in the last paragraph on what tree ColdFusion searches
    and where it
    stops.

  • Migrate coldfusion from windows to linux

    Hello Everyons,
    we're running about 50 (not very complex) coldfusion mx7
    websites on our windows server.
    we've been contemplating to change to a linux server though.
    can anyone inform us on particular pro's and/or con's for
    such a migration?
    are the website going to behave differently on linux?
    is our coldfusion license for windows also usable for linux?
    tnx for your remarks!

    Here are some points that you need to be careful.
    - File naming. Linux is case sensitive.
    “Application.cfm” and “application.cfm” are
    different files and CF looks for “Application.cfm” or
    “OnRequestEnd.cfm” etc..
    - Directory reference is different. Be careful for your
    application specially for CFFILE etc. tags.
    - “/” instead of “\”.
    - There is no C CFX tags on Linux. Be sure that you
    don’t need any Win based components.
    - There is no COM objects on Linux (some of them have support
    with 3rd part tools but this is in general). If you have any COM
    usage, forget it.
    - Verity has different behaviors on Linux. (Check CF
    technotes for details)
    - Go with Debian Linux as server platform! Debian rulez! :)
    There would be some more suggestions but these are my
    response in 2 min.
    IMHO.

Maybe you are looking for