[英]How can I access a public static member of a Java class from ColdFusion?
如何从ColdFusion访问Java类的公共静态成员?
You run the createObject but don't call the "init" before running the static method. 您运行createObject但在运行静态方法之前不要调用“init”。 For example: 例如:
<cfset systemObject = createObject("java", "java.lang.System") />
<cfoutput>#systemObject.currentTimeMillis()#</cfoutput>
In this case "currentTimeMillis()" is a static method of the System class. 在这种情况下,“currentTimeMillis()”是System类的静态方法。
我还要提到该类必须在CF的类路径中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.