Coldfusion 10允许为POST请求参数的最大数量设置限制(服务器设置/设置/请求大小限制/ POST请求参数的最大数量).默认限制为100.
是否可以在超出此限制时进行陷阱,以便可以使用自定义处理程序进行处理? 如果有,怎么样?
我试图在Application.cfc中使用站点范围的错误处理程序和onError()方法来捕获它.两次尝试都没有成功.
谢谢你的期待.
下面脚本中的第2行生成 -
"无法转换值"System.Object []"键入"System.Xml.XmlDocument".错误:"'→',十六进制值0x1A,是无效字符.第39行,第23位."
在行:1 char:8 + [xml] $ x <<<< = Get-Content 4517.xml + CategoryInfo:MetadataError:(:) [],ArgumentTransformationMetadataException + FullyQualifiedErrorId:RuntimeException"
应该在第4行(脚本)指定什么异常来捕获上述错误?
try {
[xml]$xml = Get-Content $file # line 2
}
catch [?] { # line 4
echo "XML parse error!"
# handle the parse error differently
}
catch {
echo $error
# some general error
}
Run Code Online (Sandbox Code Playgroud)
感谢您寻找(并回答)
阿德里安
下面的代码在CF10中有一些意想不到的行为,特别是与CF8相比时(我没有在CF9中尝试过).
第6行导致某些先前定义的结构成员变为未定义.为什么?这是一个错误还是我错过了备忘录?
<cfset struct = structNew()>
<cfset struct["x.foo"] = 1> <!--- LINE 2 --->
<cfset struct["x.bar"] = 2> <!--- LINE 3 --->
<cfdump var="#struct#" label="before"> <!--- struct["x.foo"] & struct["x.bar"] have values (they're defined) at this point --->
<cfset struct["x"] = structNew()> <!--- LINE 6: in CF10 struct["x.foo"] & struct["x.bar"] become undefined --->
<cfdump var="#struct#" label="after">
<h3>Coldfusion Version</h3>
#server.coldfusion.productversion#
Run Code Online (Sandbox Code Playgroud)

谢谢你的期待.