Professional Web Applications Themes

Finding CFCs - Coldfusion - Advanced Techniques

Mmy cfc's are in a CFC directory under my application root. When creating CFC's, if only the component name is specified, the current template folder is first checked and then the folders specified in Admin mappings for the CFC. My CFC folder is mapped but I can't instantiate the cfc without specifically coding <... component="cfc.Example" ...> Shouldn't I be able to just specify component="Example", if the cfc directory containing the component is mapped?...

  1. #1

    Default Finding CFCs

    Mmy cfc's are in a CFC directory under my application root. When creating
    CFC's, if only the component name is specified, the current template folder is
    first checked and then the folders specified in Admin mappings for the CFC.
    My CFC folder is mapped but I can't instantiate the cfc without specifically
    coding <... component="cfc.Example" ...> Shouldn't I be able to just specify
    component="Example", if the cfc directory containing the component is mapped?

    David Guest

  2. #2

    Default Re: Finding CFCs

    David R S wrote: 

    No, you need to tell it where to find it. What if you had two CFCs
    called "Example" in two different directories in which CF looks for
    CFCs? It wouldn't know which one you wanted.

    --
    Matt Woodward
    com
    Team Macromedia - ColdFusion
    mpwoodward Guest

  3. #3

    Default Re: Finding CFCs

    The book says you can use administrator to tell Cold Fusion where to look for
    cfc's. What we found (version 6) is that you pretty well have to put your
    cfc's in the same directory as your custom tags. It may be different for
    version 7.

    Originally posted by: David R S
    My cfc's are in a CFC directory under my application root. When creating
    CFC's, if only the component name is specified, the current template folder is
    first checked and then the folders specified in Admin mappings for the CFC.
    My CFC folder is mapped but I can't instantiate the cfc without specifically
    coding <... component="cfc.Example" ...> Shouldn't I be able to just specify
    component="Example", if the cfc directory containing the component is mapped?



    Dan Guest

  4. #4

    Default Re: Finding CFCs

    Dan Bracuk wrote: 

    How CF finds CFCs hasn't changed between version 6 and 7, and you
    definitely don't have to put CFCs in your custom tag directory. I'm not
    sure if this is the exact order in which CF looks for CFCs, but here's
    where it will look:
    1. Current directory
    2. Web server docroot and subdirectories
    3. Mapped directories
    4. Custom tag directories

    "Dot notation" like cfcs.MyCFC applies in all cases for putting CFCs in
    subdirectories of each of these and having them be found. It's really
    pretty straight-forward and logical so please feel free to ask follow-up
    questions if any of this still doesn't make sense.

    Hope that helps,
    Matt

    --
    Matt Woodward
    com
    Team Macromedia - ColdFusion
    mpwoodward Guest

Similar Threads

  1. CFCs and RemoteObject
    By spacehog in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: April 30th, 05:37 PM
  2. cftransaction across cfcs
    By andygeers in forum Coldfusion Database Access
    Replies: 0
    Last Post: April 20th, 10:25 AM
  3. CFCs not working
    By kumar1 in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: October 22nd, 03:45 AM
  4. CFCs & Dot Notation
    By jpesolutions in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: July 15th, 01:45 PM
  5. CFCs and MX7
    By ldonner in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: June 22nd, 04:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139