coldfusion - Issues with Application Scope for fetching the CFC's -
i trying cfc linked getting error:
here configration in application.cfc
<cfset application.relativepath = "/"> <cfset application.componentspath = replace(application.relativepath,"/","",'all')> <cfset application.cfcpath = application.componentspath & "com"> <cfset application.tools = '#application.cfcpath#.tools'>
now when acces cfc page this:
<cfset result = application.cfcpath.tools.savedrivers(form)>
i getting error:
element cfcpath.tools undefined in java object of type class [ljava.lang.string; referenced ''
if try
<cfset result = application.tools.savedrivers(form)>
i error:
the savedrivers method not found. either there no methods specified method name , argument types or savedrivers method overloaded argument types coldfusion cannot decipher reliably. coldfusion found 0 methods match provided arguments. if java object , verified method exists, use javacast function reduce ambiguity.
i dumped out application scope , seems ok, not sure troubling here
both application.cfcpath
, application.tools
strings, can used strings; whereas application.cfcpath.tools
within statement:
<cfset result = application.cfcpath.tools.savedrivers(form)>
is variable reference. can't have string holding variable reference , hope somehow coldfusion magically equate two.
it's unclear question whether trying create object statement, or referencing existing one. suspect it's former. in case, want sort of thing, think:
tools = createobject(application.tools);
Comments
Post a Comment