문제

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

Is "Any" the only solution?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top