将 Java 文件包含到 Coldfusion 中

Include Java Files into Coldfusion(将 Java 文件包含到 Coldfusion 中)
本文介绍了将 Java 文件包含到 Coldfusion 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 jar/java 文件包含到我的 Coldfusion 项目中.目前我正在使用这一行进入我 <cfscript>

How can I include jar/java files into my coldfusion project. currently I am using this line into me <cfscript>

我的目录是这样的

website_name
         |__ Login
             |__ connection
                |__ display.cfm
                |__ twitter
                    |__ com
                        |__ ConfigurationBuilder.java

在我的 display.cfm 文件中,我在这样的脚本中调用 obj

in my display.cfm file I am calling obj in script like this

<cfscript>
    configBuilder = createObject("java", "twitter.com.ConfigurationBuilder");
</cfscript>

但是当我运行 display.com 并且错误是这样的

but it gives me error on this line when I run display.com and error is this

An exception occurred while instantiating a Java object. The class must not be 
an interface or an abstract class. Error: ''. 

The error occurred in website_name/login/azam/connection/display.cfm: line 57


57 :            configBuilder = createObject("java", "twitter.com.ConfigurationBuilder");

如何调用我的 java 类以及如何调用它的函数以便我可以调用我的 twitter 函数.

How can I call my java class and how to call its function so that I can call my twitter function.

推荐答案

将类或 jar 文件添加到类路径的最简单方法是简单地将它们放到 lib 目录中,它们会自动被拾取.该目录位于 {cf_installation}/servers/lib.这些类文件将可供所有服务器使用.

The easiest way to add class or jar files to your class path is to simply drop them in the lib directory where they are automatically picked up. The directory is located at {cf_installation}/servers/lib. These class files will be available to all servers.

http://blogs.adobe.com/cantrell/archives/2004/07/the_definitive.html

这篇关于将 Java 文件包含到 Coldfusion 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How can create a producer using Spring Cloud Kafka Stream 3.1(如何使用Spring Cloud Kafka Stream 3.1创建制片人)
Insert a position in a linked list Java(在链接列表中插入位置Java)
Did I write this constructor properly?(我是否正确地编写了这个构造函数?)
Head value set to null but tail value still gets displayed(Head值设置为空,但仍显示Tail值)
printing nodes from a singly-linked list(打印单链接列表中的节点)
Control namespace prefixes in web services?(控制Web服务中的命名空间前缀?)