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 6227705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:16:04+00:00 2026-05-24T09:16:04+00:00

i am using the latest version of railo, and am trying to get the

  • 0

i am using the latest version of railo, and am trying to get the per-application mappings to work. this is what i am doing:

<cfcomponent name="MyApp">
    <cfset THIS.Name = "MyApp">
    <cfset THIS.Mappings["/myapp"] = ExpandPath(".")>
</cfcomponent>

so, i am trying to be able to access components within this application folder through a myapp.* mappings rather than having to to rootapp.myapp.* (from what i understand, this component setup should then work.

however, my components cannot be accessed by this mapping, and when i do a cfdump on the application variable in my code, it will show that the “applicationname” is set to “MyApp”, but nothing shows for the mappings.

does railo not support these mappings, or am i doing something wrong?

EDIT:

this is the exact error that i am getting:

invalid component definition, can't find myapp.data.MyObject

the myapp mapping should have been made, and the MyObject does exist. here is my structure:

/rootfolder/myapp/Application.cfc
/rootfolder/myapp/data/MyObject.cfc
/rootfolder/myapp/pages/MyPage.cfm

in short, “MyPage.cfm” relies on the mapping to easily access the “MyObject” component. the Application.cfc should be loaded as the cfml processor should start moving up directories until it finds one.

  • 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-24T09:16:05+00:00Added an answer on May 24, 2026 at 9:16 am

    Your syntax is OK, I’ve just did the same for application deep in directories tree and it works fine.

    however, my components cannot be accessed by this mapping,

    What is exact error? “invalid component definition, can’t find myapp.xyz”?

    Are your cfm and cfc in the same directory? (this is basically what you are trying to do)

    and when i do a cfdump on the application variable in my code, it will show that the “applicationname” is set to “MyApp”, but nothing shows for the mappings.

    You wont see this info by dumping the application scope. Only option is to use Application.cfc as usual cfc.

    <cfset app = CreateObject("component",  "application") />
    <cfdump var="#app#">
    

    EDIT. You have two solutions here.

    Define mapping like this, so path will be calculated for Application.cfc:

    <cfset this.mappings["/myapp2"] = getDirectoryFromPath(getCurrentTemplatePath())>
    

    Or change component path like this:

    <cfset MyObject = CreateObject("component",  "myapp.data.MyObject") />
    

    Problem is in differences between paths returned by ExpandPath and getCurrentTemplatePath().

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

Sidebar

Related Questions

I'm using the latest version of Gradle (milestone 9), and I'm trying to figure
I'm using derived tables (latest version of MySQL) to get counts and data from
I am using latest version of Mono.cecil What I am trying to do is
I've just started to write an application using the latest version of Rails and
I'm using Rails 3.2.3 and Ruby 1.9.3 along with the latest version of gmaps4rails.
Using the latest version of Resharper (4.5.x) with VS2008. Every now and then (pretty
I'm using the latest version of the jquery plugin DataTables and I tried to
I'm using XAMPP (latest version) on OS 10.6.2, that's bundled with PHP 5.3.0 I
Hello i am using the latest version of artoolkit, and succesfully compiled simplevrml, but
I am using the latest version of protobuf-net with VS2008 integration. I have created

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.