Highlighted

Using dot(.) in custom tag variable

New Here ,
Mar 23, 2017

Copy link to clipboard

Copied

Hi,

I want to implement a custom tag for <cfset. I am able to implement but facing issue that i cannot use dot(.) operator in variable name

For e.g.

<cf_set url.value="123"> is not allowed and it gives following error:

coldfusion.compiler.TokenMgrError: Invalid token . found on line 8 at column 27. 
at coldfusion.compiler.cfml40TokenManager.getNextToken(cfml40TokenManager.java:6658)
at coldfusion.compiler.cfml40.jj_ntk(cfml40.java:13711)
at coldfusion.compiler.cfml40.TagAttribute(cfml40.java:5488)
at coldfusion.compiler.cfml40.attribute_list_aux(cfml40.java:5356)
at coldfusion.compiler.cfml40.attribute_list(cfml40.java:5334)
at coldfusion.compiler.cfml40.cftag(cfml40.java:224)

but "." operator is allowed with <cfset url.value and it works fine.

Please provide thoughts to resolve it for use of "." with custom tag variable name

Views

345

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Using dot(.) in custom tag variable

New Here ,
Mar 23, 2017

Copy link to clipboard

Copied

Hi,

I want to implement a custom tag for <cfset. I am able to implement but facing issue that i cannot use dot(.) operator in variable name

For e.g.

<cf_set url.value="123"> is not allowed and it gives following error:

coldfusion.compiler.TokenMgrError: Invalid token . found on line 8 at column 27. 
at coldfusion.compiler.cfml40TokenManager.getNextToken(cfml40TokenManager.java:6658)
at coldfusion.compiler.cfml40.jj_ntk(cfml40.java:13711)
at coldfusion.compiler.cfml40.TagAttribute(cfml40.java:5488)
at coldfusion.compiler.cfml40.attribute_list_aux(cfml40.java:5356)
at coldfusion.compiler.cfml40.attribute_list(cfml40.java:5334)
at coldfusion.compiler.cfml40.cftag(cfml40.java:224)

but "." operator is allowed with <cfset url.value and it works fine.

Please provide thoughts to resolve it for use of "." with custom tag variable name

Views

346

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 23, 2017 0
LEGEND ,
Mar 23, 2017

Copy link to clipboard

Copied

Can't say, for sure, without seeing the code for your custom tag "set".

Variables cannot be named using punctuation (except maybe underscore), which your tag thinks "url.value" is the name of the variable, not a variable within the URL scope.

HTH,

^_^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 23, 2017 0
haxtbh LATEST
Advocate ,
Mar 23, 2017

Copy link to clipboard

Copied

If you are trying to rewrite the url scope with a custom tag, this wont be possible.

What you want to do is pass the scope into the custom tag and return the sanitise version.

<cf_set value="#url.value#" returnvar="someValue" >

<cfdump var="#someValue#">

Something like this - coldfusion custom tag return variable - Stack Overflow

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 23, 2017 0