久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 Coldfusion 中使用 java 文件

How do you use java files in Coldfusion(如何在 Coldfusion 中使用 java 文件)
本文介紹了如何在 Coldfusion 中使用 java 文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我需要將 java 文件導入 Coldfusion 8 頁面,例如:

I need to import a java file into a coldfusion 8 page e.g. :

public class Hello 
{ 
    public String testJava() 
    { 
    return "Hello Java!!"; 
    } 
}

在 Coldfusion 中,我有以下代碼:

In Coldfusion I have the following code:

<cfscript>
   helloWorld = CreateObject("java","Hello");
   helloTest = helloWorld.testJava();
</cfscript>

然后我收到錯誤

對象實例化異常.找不到類:你好

Object Instantiation Exception. Class not found: Hello

在我的 Coldfusion 服務(wù)器中,Java 虛擬機路徑設(shè)置為C:/ColdFusion8/runtime/jre",所以這是我放置 java 文件的位置,對嗎?我應該在里面放一個 .java、.class 還是 .jar?

In my Coldfusion server Java Virtual Machine Path is set to 'C:/ColdFusion8/runtime/jre', So this is where I have put my java file, is this correct? Should I put a .java, .class or .jar there?

文件名需要和類名一致嗎?

Does the file name need to be consistent with class name?

有沒有人可以嘗試類似的工作示例代碼?

Does anyone have working sample code for something similar I can try?

推薦答案

您需要將文件放在 ColdFusion JVM 的類路徑中,而不是其 JRE 目錄中.

You need to put the files on the ColdFusion JVM's classpath, not in its JRE dir.

一般來說,如果你有一個jar文件,把它放在實例的WEB-INF/lib目錄,如果它只是一個類,把它放在WEB-INF/classes 目錄,例如:對我來說后者是 C:appsadobeColdFusion11fullcfusionwwwrootWEB-INFclasses,其中 C:appsadobeColdFusion11full 是我安裝 CF 的地方,cfusion 是實例的名稱.

As a rule, if you have a jar file, put it in the instances's WEB-INF/lib dir, if it's just a class, put it in the WEB-INF/classes dir, eg: for me the latter would be C:appsadobeColdFusion11fullcfusionwwwrootWEB-INFclasses, where C:appsadobeColdFusion11full is where I installed CF, and cfusion is the name of the instance.

這篇關(guān)于如何在 Coldfusion 中使用 java 文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環(huán)繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數(shù)據(jù)庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 成人黄色小视频 | 成人综合网站 | 激情视频网| 国产无遮挡又黄又爽免费网站 | 精品一区二区三区在线观看 | 亚洲综合激情五月久久 | 日本美女性生活 | 亚洲天码中字 | 黄色福利网站 | 色综合小说 | 国产高清成人 | 欧美激情综合五月色丁香 | 亚洲成人免费视频 | 伊人久久久 | 亚洲国产日韩在线 | 999国产视频 | 日日干夜夜操 | 欧美精品一二区 | 视频一区二区在线 | 欧美一级片在线观看 | 国产不卡视频 | 免费看黄色大片 | 日本公妇乱偷中文字幕 | 伊人网在线视频 | 天天躁日日躁狠狠躁伊人 | 中文字幕在线免费 | 欧美久久久久久久 | 中文字幕免费观看视频 | 国产黄色片视频 | 日韩视频免费观看 | 国产成人精品在线观看 | 国产精品视频专区 | 久久性视频 | 日韩一区二区三免费高清在线观看 | 4438成人网 | 97久久久| 激情六月婷婷 | 中文字幕2021| 女教师合集乱500篇小说 | 日本免费一级片 | 国产成人在线免费视频 |