Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Get / Cast a Java Object

New Here ,
Jun 22, 2010 Jun 22, 2010

Does anybody know how to get (or Cast) a Java Object returned from a Java method call ?

Example:

<cfset someList = object1.method1(someString, JavaCast("float",someNumber),...)>


This method returns a list of Java object of type "Object2". ie. it returns List<Object2>

Now I attempted to loop thru each objects from the returned list, and invoke some method on them, using code similar to below,

<cfset var="#someList[index]#"/>


but ColdFusion does not seem to understand the object "var" as Java "Object2". Is there any way I can cast the "var" to "Object2"?

Thanks in advance.

Xiaoling

325
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 23, 2010 Jun 23, 2010
LATEST

"var" is a reserved keyword! You can initialize variables with "var" in the beginning of a component, but do not use it as a variables name:

<cfset var someVar = "#someList[index]#">

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources