我有一个表单提交问题。我使用的是ColdFusion 10,我看不出我的代码有什么问题。表单将提交到操作页面。在操作页面中,我调用了一个组件:
<cfif IsDefined("Form.Run")><!--- Form is submitted, call this comp --->
<CFSET UpdObj = New cfcomponents.GComp.g_IsExist_1(Form.Sh, Form.LY)>
<cfdump var="#UpdObj#><cfabort>
</cfif 我收到以下错误消息:在第117行的127列发现无效的CFML构造。我了解到这是在CF10中调用组件的正确方法。为什么我会收到这个错误信息?第117行中没有任何内容
发布于 2014-10-22 02:38:33
您有语法错误。正如其他人所提到的,您可以使用createObject,但使用new操作数可能更适合您的风格,因为它是您的代码示例中的内容:
<cfif structKeyExists(form, "run")><!--- Form is submitted, call this comp --->
<cfset UpdObj = new cfcomponents.GComp() /> <!--- Calls init() if it exists --->
<cfset exists = UpdObj.g_IsExist_1(Form.Sh, Form.LY) />
<cfdump var="#UpdObj#" abort="true" />
</cfif>https://stackoverflow.com/questions/26493404
复制相似问题