We're updating the issue view to help you get more done. 

invokeImplicitAccessor not respected when request is via REST

Description

Copied from https://issues.jboss.org/browse/RAILO-3294

Repro:

File structure:

1 2 3 4 5 6 7 [base] Application.cfc thing.cfm api\ Test.cfc cfcs\ Thing.cfc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // 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"); } }
1 2 3 4 5 6 // Thing.cfc component accessors=true { property key; }
1 2 3 4 5 6 7 8 9 10 11 12 // 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}; } }
1 2 3 4 5 6 7 8 9 <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.

Environment

None

Status

Assignee

Unassigned

Reporter

Adam Cameron

Labels

None

Priority

New