Solved

cfinvoke path

Posted on 2004-04-26
7
784 Views
Last Modified: 2013-12-24
do i need to use a different path than below if the cfm and cfc are not in the same folder?

<cfif isDefined("url.addProdID")>
<cfinvoke component="cartservice" method="newCart" >
</cfinvoke>
</cfif>


should i do this if the cfc is in a folder


<cfif isDefined("url.addProdID")>
<cfinvoke component="api/cartservice" method="newCart" >
</cfinvoke>
</cfif>
0
Comment
Question by:finnstone
  • 3
  • 3
7 Comments
 
LVL 17

Assisted Solution

by:Tacobell777
Tacobell777 earned 200 total points
ID: 10924422
you can use the dot notation and you can use mappings, example:

/mapping/directory/cartservice
mapping.directory.cartservice
0
 

Author Comment

by:finnstone
ID: 10924460
what is mapping in your example.

what shuld i do if my cfm is in wwroot/show

and my cfc is in wwroot/show/api
0
 
LVL 18

Accepted Solution

by:
Plucka earned 300 total points
ID: 10924479
Hi finnstone,

You need to setup a mapping in CF administrator.

This mapping points to a directory containing your componenets, then you reference them with . (dot) notation.

MappingName.DirectoryName.Component Name

So if you have this structure.

C:\Com\test
C:\Com\live

and you have components in both test and live. You would setup a mapping say called com to C:\Com\

And then call the component using com.test.ComponentName

Regards
Plucka
0
Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

 
LVL 18

Expert Comment

by:Plucka
ID: 10924489
finnstone,

> what shuld i do if my cfm is in wwroot/show
> and my cfc is in wwroot/show/api

I'd setup a mapping in cf administrator called api pointing to wwroot/show/api.

Then in code

<cfinvoke component="api.cartservice" method="newCart" >

Regards
Plucka
0
 

Author Comment

by:finnstone
ID: 10924499
oh..if i dont want to use a mapping, can i just use a absolute URL
0
 
LVL 18

Expert Comment

by:Plucka
ID: 10924511
No, you must use a mapping unless it's in the current directory.
0
 

Author Comment

by:finnstone
ID: 10924550
ok thx
0

Featured Post

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now