【发布时间】:2015-11-03 01:37:35
【问题描述】:
我在 Ubuntu 14.04.3 LTS 上运行 Lucee 4.5.1.023。当我创建一个 .cfm 文件并执行 cfoutput 或 cfdump 时,输出与您期望的一样。但是,当我在 CFC 中使用函数并将函数设置为 output="true" 并执行 cfoutput 或 cfdump 时,结果是以下“XML Parsing Error: not well-formed”。
<cfcomponent>
<cffunction name="test" access="remote" output="true">
<cfoutput>#now()#</cfoutput>
</cffunction>
</cfcomponent>
如果 output="false" 并且根本没有生成输出,则返回 XML 解析错误。例如
<cfcomponent>
<cffunction name="test" access="remote" output="false">
<cfset var a = 1>
</cffunction>
</cfcomponent>
任何帮助或建议将不胜感激。
【问题讨论】:
-
我知道这是一篇相当老的帖子,但它今天发生在我身上。为了解决这个错误,我添加了一个 `cfheader(name="Content-Type", value="text/html"); ` 在输出之前的函数中。像魅力一样工作。