Rest 在{}速记中定义的Coldfusion CFC行为怪异

Rest 在{}速记中定义的Coldfusion CFC行为怪异,rest,coldfusion,cfc,Rest,Coldfusion,Cfc,使用速记法定义cfc的怪异行为: component { remote string function get() httpmethod="GET" returnformat="plain" { return "hello world"; } } 与以这种方式定义的预期行为相比: <cfcomponent> <cffunction name="get" access

使用速记法定义cfc的怪异行为:

component {
    remote string function get() httpmethod="GET" returnformat="plain" {
    return "hello world";
    }
}
与以这种方式定义的预期行为相比:

<cfcomponent>
    <cffunction name="get" access="remote" returntype="String" httpmethod="GET">
        <cfreturn "hello world">
    </cffunction>
</cfcomponent>

第二个称为REST服务的示例正确地返回hello world

但是,第一个示例返回hello world,但也附加了整个组件的.cfc代码,如下所示:

helloworldcomponent{remotestring函数get(){返回“helloworld”}


任何人知道这是什么原因吗?我被难住了。Thks

ColdFusion的哪个版本?我想知道您是否可以将第一个版本包装在
中,这是否有助于您使用的web服务器?似乎web服务器只是给您文件的内容。但是没有解释你是如何得到函数输出的?通过将以下内容从Application.CFC移动到发现了一个修复方法。我不完全明白为什么。奇怪的行为只在新的托管服务器上出现。这两个示例在我的本地开发安装ColdFusion 2018上都可以正常工作。IIS web服务器