Question

When I try to call a .CFC file from a .CFM file, the .CFC file will execute its code, but once its done I'm re-routed to a ColdFusion admin login window. I even went as far as removing all the code from the .cfc file and it still, so essentially it does nothing and it didn't matter, as soon as it finished running the .cfc it went to a ColdFusion login window. I removed the .cfc file and this no longer occurred. What do I have to do to call .CFC files in ColdFusion? Is this a ColdFusion setting?

enter image description here

Was it helpful?

Solution

When you browse to a CFC, CFCExplorer will run to show you a Javadoc-like generated documentation. That's why you see that login page.

The code in your CFC got executed is just a side effect of CF instantiating your CFC to inspect its content.

You generally want to do the code execution in a CFM, with CFC used to handle your OO things.

One exception might be foo.cfc?method=someAjaxMethod&Arg1=bar, for invoking remote method by ajax.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top