简体   繁体   中英

Lucee - Coldfusion new keyword not working

I am trying to invoke a component using the new keyword but it is not working.

The following method below works fine:

<cfset test = CreateObject("component", "test-objects.shipping_new").init(bar="Blah", foo="boom")>

But when I try to use the following:

<cfset test = New test-objects.shipping_new(bar="Blah", foo="boom") />

I get the error tag cfset is not closed . The code above is the first line in the file I am trying to invoke it from, unless I am missing something the tag looks closed to me. I am using Lucee 4.5 if that makes a difference.

The problem is the hyphen :

If the folder name or CFC name has hyphen, use the following syntax:

cfObject=new "cfc-path"(constructorParam1,...)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM