在lotusScript中使用javaClass
你好强> 首先,请原谅我的英语不好C 我尝试在DominoLotusScript中使用我的Java类 我这样做:以我的全球形式在lotusScript中使用javaClass,java,lotus-domino,lotus,Java,Lotus Domino,Lotus,你好 首先,请原谅我的英语不好C 我尝试在DominoLotusScript中使用我的Java类 我这样做:以我的全球形式 Option Public Uselsx "*javacon" Use "libEssai" 在我的Clic按钮中: Sub Click(Source As Button) Dim mySession As JAVASESSION Dim utilDate As JAVACLASS Dim objUtilDate As JAVAO
Option Public
Uselsx "*javacon"
Use "libEssai"
在我的Clic按钮中:
Sub Click(Source As Button)
Dim mySession As JAVASESSION
Dim utilDate As JAVACLASS
Dim objUtilDate As JAVAOBJECT
Dim toto As String
Set mySession = New JAVASESSION
Set utilDate = mySession.GetClass("test/UtilDate")
Set objUtilDate = utilDate.CreateObject
toto = objUtilDate.essaiMethode
Messagebox (toto + "*******************************************************")
End Sub
我尝试将该类放入java库(Code/library/libEssai)和java包(Code/java/package test/UtilDAte.java)我试了两种方法,结果都一样 这是一个要测试的“hello word”类java
package test;
public class UtilDate {
public String essaiMethode() {
String texte = null;
texte = "Bonjour";
return texte;
}
}
我的错误是:
"Instance member ESSAIMETHODE does not exist"
我不明白,你能帮我吗?
谢谢你的帮助!
;D
我找到了
Sub Click(Source As Button)
Dim mySession As JAVASESSION
Dim utilDate As JAVACLASS
Dim objUtilDate As JAVAOBJECT
Dim toto As String
Dim toto2 As String
Dim myMCollection As JavaMethodCollection
Dim myMethod As JavaMethod
Dim methodJava As JavaMethod
toto2 = "test"
Set mySession = New JAVASESSION
Set utilDate = mySession.GetClass("test/UtilEssai")
Set objUtilDate = utilDate.CreateObject
Messagebox (toto2)
Set myMCollection = utilDate.getClassMethods()
Set myMethod = myMCollection.getFirst()
Do
If myMCollection.count <> 0 Then
toto2 = myMethod.MethodName & " " & myMethod.signature
Messagebox (toto2)
If myMethod.MethodName = "essaiMethode" Then
Set methodJava = utilDate.GetMethod("essaiMethode","()Ljava/lang/String;")
toto = methodJava.Invoke(objUtilDate)
Messagebox (toto)
End If
End If
Set myMethod = myMCollection.getNext()
Loop While myMCollection.current <> 1
End Sub
子单击(源代码为按钮)
Dim mySession作为JAVASESSION
Dim utilDate作为JAVACLASS
Dim objUtilDate作为JAVAOBJECT
把托托调成弦
作为字符串的Dim tototo2
Dim myMCollection作为JavaMethodCollection
Dim myMethod作为JavaMethod
Dim methodJava作为JavaMethod
toto2=“测试”
Set mySession=newjavasession
Set-utilDate=mySession.GetClass(“test/UtilEssai”)
设置objUtilDate=utilDate.CreateObject
信息箱(TOTOO2)
设置myMCollection=utilDate.getClassMethods()
Set myMethod=myMCollection.getFirst()
做
如果myMCollection.count为0,则
toto2=myMethod.MethodName&&myMethod.signature
信息箱(TOTOO2)
如果myMethod.MethodName=“essaiMethode”,则
Set methodJava=utilDate.GetMethod(“essaiMethode”,“()Ljava/lang/String;”)
toto=methodJava.Invoke(objUtilDate)
信息箱(toto)
如果结束
如果结束
Set myMethod=myMCollection.getNext()
在myMCollection.1当前时循环
端接头
我找到了,非常感谢
Sub Click(Source As Button)
Dim mySession As JAVASESSION
Dim utilDate As JAVACLASS
Dim objUtilDate As JAVAOBJECT
Dim toto As String
Dim toto2 As String
Dim myMCollection As JavaMethodCollection
Dim myMethod As JavaMethod
Dim methodJava As JavaMethod
toto2 = "test"
Set mySession = New JAVASESSION
Set utilDate = mySession.GetClass("test/UtilEssai")
Set objUtilDate = utilDate.CreateObject
Messagebox (toto2)
Set myMCollection = utilDate.getClassMethods()
Set myMethod = myMCollection.getFirst()
Do
If myMCollection.count <> 0 Then
toto2 = myMethod.MethodName & " " & myMethod.signature
Messagebox (toto2)
If myMethod.MethodName = "essaiMethode" Then
Set methodJava = utilDate.GetMethod("essaiMethode","()Ljava/lang/String;")
toto = methodJava.Invoke(objUtilDate)
Messagebox (toto)
End If
End If
Set myMethod = myMCollection.getNext()
Loop While myMCollection.current <> 1
End Sub
子单击(源代码为按钮)
Dim mySession作为JAVASESSION
Dim utilDate作为JAVACLASS
Dim objUtilDate作为JAVAOBJECT
把托托调成弦
作为字符串的Dim tototo2
Dim myMCollection作为JavaMethodCollection
Dim myMethod作为JavaMethod
Dim methodJava作为JavaMethod
toto2=“测试”
Set mySession=newjavasession
Set-utilDate=mySession.GetClass(“test/UtilEssai”)
设置objUtilDate=utilDate.CreateObject
信息箱(TOTOO2)
设置myMCollection=utilDate.getClassMethods()
Set myMethod=myMCollection.getFirst()
做
如果myMCollection.count为0,则
toto2=myMethod.MethodName&&myMethod.signature
信息箱(TOTOO2)
如果myMethod.MethodName=“essaiMethode”,则
Set methodJava=utilDate.GetMethod(“essaiMethode”,“()Ljava/lang/String;”)
toto=methodJava.Invoke(objUtilDate)
信息箱(toto)
如果结束
如果结束
Set myMethod=myMCollection.getNext()
在myMCollection.1当前时循环
端接头
您可以添加更新作为答案,然后接受它