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

  • Home
  • SEARCH
  • 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 642247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:09:01+00:00 2026-05-13T21:09:01+00:00

Is there a way to specify the component path in the tag? I am

  • 0

Is there a way to specify the component path in the tag?

I am using ColdFusion Components for my application. My application has several folders, however, and each time I want a CFC to work, I have to save it in the same directory as those files that need access. This results in my creating of several CFC files that are identical.

Is there a way to store my CFCs in one directory and make it work across my site?

  • 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-13T21:09:02+00:00Added an answer on May 13, 2026 at 9:09 pm

    As others have noted, you can do interesting things with mappings and functions that locate the root of your application, but at the heart of your question is general path specification.

    I would suggest you read the portion of the Using ColdFusion Components documentation titled Specifying the CFC location.

    Essentially, what it says is that if your application lives at http://example.com/myApp/ and you have a page at http://example.com/myApp/foo/bar/fubar.cfm that wants to use the component at:

    /myApp/foo/components/library/fubar.cfc
    

    then fubar.cfm should do something like this:

    <cfset fubar=createObject("component", "myApp.foo.components.library.fubar") />
    

    You take the path of the file and replace slashes with dots (aka “dot notation”), and also drop the “.cfc” from the file name of the component you want to load.

    In addition, you can use named mappings (as Aaron described), so if you create a mapping called /components that points to /myApp/foo/components/ then your createObject call would look like this:

    <cfset fubar = createObject("component", "components.library.fubar") />
    

    The same dot-notation paths can be used in <cfinvoke />, as part of the component attribute:

    <cfinvoke component="components.library.fubar" ... />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to specify that a model (or app, even) should only
Is there a way to specify a value to the text_area method that will
Is there a way to specify include directories in the code, perhaps via a
Is there a way to specify a dynamic callback url for the redirect from
Is there a way to specify a file extension for ASP.NET upload control? E.g.
Is there any way to specify SQL comments through JPA annotations? Comments for tables
Hey is there a way to specify a fallback js just in case loading
I looked through the documentation but couldn't find if there is a way to
I know that you can cache the WSDL but is there a way to
I'm in the process of designing the architecture of an application I’m planning on

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.