cfc

How can I send HTTP Status Code and a Response messages to the client in ColdFusion?

末鹿安然 提交于 2019-12-11 05:27:33
问题 I am implementing the Single Sign On functionality. I have an ColdFusion application which takes input parameters from Java application (POST request). What I need to do is return status codes and a description to indicate whether the user has access and the failed reason if the user does not have access to my CF application. Something like below: I have created a cfc and provided this as an API to allow Java users to pass in their UserName, CustomerID to my CF application. Do I need to write

Ajax jQuery call to ColdFusion component

倾然丶 夕夏残阳落幕 提交于 2019-12-11 04:05:47
问题 I'm new to jQuery and am trying to create a login page that will do an Ajax call to a CFC that simply returns true or false on whether login was successfull. My call is making it to the CFC with my arguments correctly, but what's getting returned is the problem. If I set my datatype in jQuery to be "html", I see what looks like a copy of my entire page in html along with the "true" value I'm looking for. But if I try setting it to "json" nothing happens. I'm on ColdFusion 9, jQuery 1.6.2. My

How to get the name of the component that's extending mine in ColdFusion?

感情迁移 提交于 2019-12-11 03:53:32
问题 Let's say I have the following component called Base : <cfcomponent output="false"> <cffunction name="init" access="public" returntype="Any" output="false"> <cfset variables.metadata = getmetadata(this)> <cfreturn this> </cffunction> <cffunction name="getmeta" access="public" returntype="Any" output="false"> <cfreturn variables.metadata> </cffunction> </cfcomponent> and I want to extend base in another component called Admin : <cfcomponent output="false" extends="Base"> </cfcomponent> Now

Possible race conditions when creating and updating a struct in the same request - coldfusion

女生的网名这么多〃 提交于 2019-12-11 02:39:30
问题 About a year ago I asked a question about errors I was getting in an app, that indicated a possible race condition: Possible race condition creating Structs in ColdFusion A year on, I'm still having issues with this and other apps where the same technique is employed and it seems that frankly, you cannot create and update a struct reliably in the same request. This of course seems ludicrous, so I must be doing something wrong - but I'd appreciate some help. Here's an explanation of what's

why I can't call functions in a Coldfusion CFC on live server when it works on production?

拥有回忆 提交于 2019-12-11 01:57:00
问题 I'm at a loss. I'm posting to a Coldfusion8 cfc via Ajax and while it works fine on my local machine, on the live server I cannot call any function in this CFC or it's extended CFC. I want to do this: <cfset LOCAL.response = THIS.commit() /> If I dump: <cfdump output="e:\path\to\dump.txt" label="catch" var="committing"> <cfdump output="e:\path\to\dump.txt" label="catch" var="#THIS#"> <cfset dickhead = THIS.Commit() > <cfdump output="e:\path\to\dump.txt" label="catch" var="out"> I'm getting:

ColdFusion Components Inheriting Functions Of Others

天大地大妈咪最大 提交于 2019-12-10 21:28:05
问题 I have two simple CFCs as shown below: Test1.cfc <cfcomponent> <cffunction name="initMethod1" access="private" returntype="boolean"> <cfreturn true /> </cfcomponent> Test2.cfc <cfcomponent> <cffunction name="initMethod2" access="private" returntype="boolean"> <cfreturn true /> </cfcomponent> During OnApplicationStart() of Application.cfc, I make the following calls: <cfset application["Test1"] = CreateObject("component","jbx.c.Test1") /> <cfset application["Test2"] = CreateObject("component",

When to var scope your variables in ColdFusion components?

一世执手 提交于 2019-12-10 14:58:34
问题 (a) What cases should you var scope variables and (b) what cases should you not var scope in a ColdFusion components? 回答1: You should var scope your variables when you're implementing a function inside a CFC that is shared across multiple requests (i.e. Singleton, Service CFC's in Application scope) You don't need to (yet still highly recommended to) var scope your variables if the CFC is instantiated every time, AND your method is not calling another method in the same CFC that may access

Extend a CFC using a relative path

拟墨画扇 提交于 2019-12-08 23:54:48
问题 I want to extend a CFC in a different directory and I have a couple of options, but can't figure out how to do this: A) Use a dynamic mapping (this will have to be dynamic based on the site, e.g. for the live site it would be cfc.myPackage.MyCFC but on a dev site it would be myCfcRoot.myPackage.MyCFC) - I've tried putting expressions into the extends bit but obviously CF doesn't like that, e.g. : <cfcomponent name="MyComponent" extends="#config.cfcRoot#.BaseComponent"> or <cfcomponent name=

Find who's calling the method

白昼怎懂夜的黑 提交于 2019-12-08 15:45:14
问题 I'd like to somehow find out which CFC is calling my method. I have a logging CFC which is called by many different CFC's. On this logging CFC there's a need to store which CFC called for the log. Whilst I could simply pass the CFC name as an argument to my log.cfc, I find this to be a repetitive task, that might not be necessary, if I somehow could find out "who's" calling the method on log.cfc Is there any programmatic way of achieving this? Thanks in advance 回答1: Update : As Richard Tingle

Dynamic Variable Names Coldfusion

旧巷老猫 提交于 2019-12-08 02:06:19
问题 Hey Guys, I'm having a tad of an issue dealing with Dynamic Variable Names. What is happening is I have a CFC that builds part of form for me using some data in a table. Then the cfc sends the form's code back to the page as a string. Well I need to assign values to these form fields so people don't overwrite the data. I'm pulling the data in the function in the cfc. So I'm trying to throw this dynamic variable into the string and it is messing things up for me. I keep getting an error saying