在cfhttparam中传递电子邮件地址时找到无效的令牌@

时间:2014-08-18 23:47:53

标签: coldfusion coldfusion-9

我正在尝试传递两个电子邮件地址(JSON值),如下所示:

 Line#91  <cfhttpparam type="formfield" name="inpEmailObject"
             value="["email1@gmail.com","email2@gmail.com"]" />

但是,我最终会遇到以下错误:

 Invalid token @ found on line 91 at column 75.

The CFML compiler was processing:

    The tag attribute email1, on line 91, column 69.
    A cfhttpparam tag beginning on line 91, column 9.

如何在值字段中传递电子邮件地址?

1 个答案:

答案 0 :(得分:3)

如果您想将双引号作为您要发送的字符串的一部分,请加倍。

value="[""email1@gmail.com"",""email2@gmail.com""]"

或者,正如安东尼所建议的那样,将一套改为单引号。这应该有效:

value='["email1@gmail.com","email2@gmail.com"]'