") from a function? Is "Any" the only solution" /> ") from a function? Is "Any" the only solution" /> ") from a function? Is "Any" the only solution"/>

What returntype should I use when returning a Java object?

312 Views Asked by At

What returntype should I use when returning a Java object created with createObject("java", "<someclass>") from a function?

Is "Any" the only solution?

1

There are 1 best solutions below

0
Leigh On BEST ANSWER

Yes, for java objects use type="any". Aside from "any", cffunction only supports basic types (string, numeric, struct, query, etcetera...). Everything else is assumed to be a component name. So using a java class name, such as java.lang.String, would cause an error because CF looks for a component with that path and obviously does not find it.