Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6357743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:13:37+00:00 2026-05-24T23:13:37+00:00

If this has been asked before I apologize but I wasn’t able to get

  • 0

If this has been asked before I apologize but I wasn’t able to get a solid enough understanding without some assistance ….

I have a Local ColdFusion9 App that I use for development and testing running on WinXP SP3 with Apache 2 …

What I’m having a problem understanding how to call request elements passed from the Application’s ‘THIS’ scope to the onRequestStart() method.

For instance, My Application.cfc has the following in ‘THIS’ …

<!--- MY 'THIS' Statements in Application.cfc --->

<cfscript>

/* define custom coldfusion mappings. Keys are mapping names, values are full paths  */
this.mappings = structNew();
this.mappings['/tags'] = ExpandPath('/cfdev/tags');

</cfscript>

Further into my Application.cfc I have the following in the onRequestStart() function …

<!--- Run before the request is processed --->
<cffunction name="onRequestStart" returnType="boolean" output="false">
    <cfargument name="thePage" type="string" required="true">
        <cfinclude template="#arguments.thePage#">

<!--- Lot's of onRequest statements and then ... --->

    <cfset request.mappings = #THIS.mappings#>

    <cfreturn true>
</cffunction>

Now … Supposing I have a page where I call <cfdump var=”#request.mappings#”> …

I get an error stating

‘Element MAPPINGS is undefined in REQUEST.’ …

However, (here’s where my confusion begins) … If I call <cfdump var=”#request#”> Two structures are returned … The first containing a key for “cfdumpinited” with a value of ‘False’ and the second with the structKey ‘mappings’ which contains another struct with a key of ‘/tags’ and a value of ‘C:\vir_dir\CFDEV\tags’ as one would expect …

If someone could please explain why it is that request succeeds yet request.mappings fails as I’m a bit in the woods here … 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:13:39+00:00Added an answer on May 24, 2026 at 11:13 pm

    Follow the logic through:

    1. a request is made
    2. onRequestStart runs
    3. you explicitly include the template requested
    4. youTHEN set request.mappings = this.mappings
    5. onrequeststart finishes
    6. the template requested executes

    So if you have this in your requested template:

    <cfdump var="#request.mappings#>
    

    Then when you include that file at step 3… request.mappings doesn’t exist yet (as they are created in step 4).

    However when you change it to:

    <cfdump var="#request#>
    

    Then there’s no error condition, so your CFINCLUDE runs fine, but DOESN’T OUTPUT ANYTHING (because you have output=”false” on the function definition.

    The dump you are seeing is the one coming from CF executing the requested template (step 6), by which time request.mappings exists.

    I think you are confusing onRequestStart() with onRequest(), to be honest. It’s in onRequest() that one might explicitly include the requested template, because onRequest() runs INSTEAD of CF running the requested template automatically. One would not generally include the requested template in onRequestStart() because it’ll end up running twice.

    Make sense?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realize this has been asked before, but I wasn't able to find a
I apologize if this has been asked before, but I haven't quite found the
If this has been asked before, I apologize but this is kinda of a
I apologize if this has been asked before. I searched but did not find
I apologize if this has been asked before but I am trying to parse
I apologize if this has been asked before, but I believe that for me,
This has been asked before by others, but I have not been able to
I apologise if this has been asked before but I can't find the info
This has been asked before (question no. 308581) , but that particular question and
I'm sure this has been asked before, but I can't find it. What are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.