Андрей Косинский:
There is a Library in the language of java, it needs to be called both with Lotus Script and SSJS. The script of the library runs without problems through Lotus Script, but there is no possibility of calling it on SSJS.
Related Articles
Java library:
public class Untitled {
public int add(int a, int b) { return a + b; }
public int div(int a, int b) { return a / b; }
public int mul(int a, int b) { return a * b; }
public int sub(int a, int b) { return a - b; }
public String dummy() {return "42"; }
}
enter image description here
Lotus Script
Option Declare
Uselsx "*javacon"
Use "one"
Dim myClass As JavaClass
Dim calculator As JavaObject
Dim mySession As JavaSession
Dim c As String
Set mySession = New JavaSession()
Set myClass = mySession.GetClass("com.two.Untitled")
Set calculator = myClass.CreateObject
c = calculator.dummy()
Messagebox c
Adding a library to the package does not work. I created the package and put the library there (Java code is similar)
SSJS
importPackage(com.myUntitled)
var myTest = new Untitled2();
return myTest.dummy();
enter image description here
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE