Details
-
Type:
Bug
-
Status: Rejected
-
Priority:
New
-
Resolution: Cannot Reproduce
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Sprint:
Description
Copied from https://issues.jboss.org/browse/RAILO-3294
Repro:
File structure:
[base] Application.cfc thing.cfm api\ Test.cfc cfcs\ Thing.cfc
// Application.cfc component { this.name = "app05"; this.mappings = { "/cfcs" = getDirectoryFromPath(getCurrentTemplatePath()) & "cfcs" }; this.invokeImplicitAccessor = true; this.webAdminPassword = "123456"; public void function onApplicationStart(){ restInitApplication(expandPath("./api"), "api"); } }
// Thing.cfc component accessors=true { property key; }
// Test.cfc component rest=true restpath="test" { import "cfcs.*"; remote struct function testMethod() httpmethod="get" restpath="" produces="application/json" { var thing = new Thing(); thing.setKey("foo"); return {key=thing.key}; } }
<cfscript> // thing.cfm import "cfcs.*"; thing = new Thing(); thing.setKey("foo"); writeDump({key=thing.key}); </cfscript>
Result of hitting thing.cfm:
Struct
key
string foo
(this is correct)
Result of hitting http://localhost:8888/rest/api/test/:
Component [Thing] has no accessible Member with name [key] enable [trigger data member] in admininistrator to also invoke getters and setters
Well:
- yes it does have an accessible property with the name key, as demonstrated via thing.cfm.
- "trigger data member" is enabled, via this.invokeImplicitAccessor=true
NB: I have verified the REST call is picking up the Application.cfc. It's just ignoring this.invokeImplicitAccessor=true.
This code also works absolutely fine on ColdFusion, so fairly confident it's not a bug with what I'm doing, it's a bug on your end of things.