Coldfusion location函数(cflocation标记)中的addtoken参数是否为布尔值?

Coldfusion location函数(cflocation标记)中的addtoken参数是否为布尔值?,coldfusion,coldfusion-9,cfml,Coldfusion,Coldfusion 9,Cfml,我用的是CF9 该函数有一个参数 addToken = "yes|no" 如果这实际上是一个布尔值,则未提及,例如,以下两个是否等效 <cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "no"> <cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "false"> 是的,它们是相同的,

我用的是CF9

该函数有一个参数

addToken = "yes|no"
如果这实际上是一个布尔值,则未提及,例如,以下两个是否等效

<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "no">
<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "false">

是的,它们是相同的,是的,您可以在cfscript中将它们作为参数传递。您甚至可以使用0和1

如属虚假:

<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "no">
<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "false">
<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "0">
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = false);</cfscript>
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = "no");</cfscript>
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = 0);</cfscript>

位置(url=”http://localhost:8500/cfdocs/dochome.htm“,addtoken=false);
位置(url=”http://localhost:8500/cfdocs/dochome.htm,addtoken=“否”);
位置(url=”http://localhost:8500/cfdocs/dochome.htm,addtoken=0);
事实上:

<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "yes">
<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "true">
<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "1">
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = true);</cfscript>
<cfscript>location(http://localhost:8500/cfdocs/dochome.htm", addtoken = "yes");</cfscript>
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = 1);</cfscript>

位置(url=”http://localhost:8500/cfdocs/dochome.htm“,addtoken=true);
位置(http://localhost:8500/cfdocs/dochome.htm,addtoken=“是”);
位置(url=”http://localhost:8500/cfdocs/dochome.htm“,addtoken=1);

顺便说一句,您可以通过创建一个小样本文件并对其进行测试来轻松验证这一点。

是的,它们是相同的,是的,您可以将它们作为参数传递到cfscript中。您甚至可以使用0和1

如属虚假:

<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "no">
<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "false">
<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "0">
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = false);</cfscript>
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = "no");</cfscript>
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = 0);</cfscript>

位置(url=”http://localhost:8500/cfdocs/dochome.htm“,addtoken=false);
位置(url=”http://localhost:8500/cfdocs/dochome.htm,addtoken=“否”);
位置(url=”http://localhost:8500/cfdocs/dochome.htm,addtoken=0);
事实上:

<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "yes">
<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "true">
<cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "1">
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = true);</cfscript>
<cfscript>location(http://localhost:8500/cfdocs/dochome.htm", addtoken = "yes");</cfscript>
<cfscript>location(url="http://localhost:8500/cfdocs/dochome.htm", addtoken = 1);</cfscript>

位置(url=”http://localhost:8500/cfdocs/dochome.htm“,addtoken=true);
位置(http://localhost:8500/cfdocs/dochome.htm,addtoken=“是”);
位置(url=”http://localhost:8500/cfdocs/dochome.htm“,addtoken=1);

顺便说一句,您可以通过创建一个小样本文件并对其进行测试来轻松验证。

我不知道如何测试
addtoken
参数是否按预期运行。@罗兰这些标记在浏览器中显示为参数(或不显示为参数)。类似于?CFID=xxxxx&CFTOKEN=xxxxx。因此,如果您创建一个使用cflocation重定向您的测试页面,您可以在浏览器url栏中将令牌作为参数看到,也可以不看到。我不知道如何测试
addtoken
参数是否按预期运行。@Roland这些令牌在浏览器中作为参数显示(或不显示)。类似于?CFID=xxxxx&CFTOKEN=xxxxx。因此,如果您创建了一个使用cflocation重定向您的测试页面,您可以在浏览器url栏中将标记作为参数看到,也可以不看到。