{} 速记中定义的 Coldfusion CFC 行为异常

问题描述

使用速记定义的 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 代码,如下所示:

hello worldcomponent { remote string function get() { return "hello world"; } }

任何人有什么想法可能导致这种情况?我难住了。谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)