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 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

I've been wondering. Using Vaadin, is there a way to specify where the caption
The TcxRadioGroup component of DevExpress has a very nice way to specify items. You
Is there any way to specify the value of the callback parameter when using
Is there any way to specify table column width as is. In other words,
Is there a way to specify the maximum recursion level for recursive diff diff
Is there a way to specify which object to use for global when invoking
Is there a way to specify the root directory at runtime within a program's
Is there any way to specify that a function should be called when a
Is there any way to specify a width when doing :vsplit? Also, is there
Is there a way to specify which namespace includes should be automatically added any

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.