Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Import a Java library and calling its classes through Lotus Script and SSJS

SOLVED: Import A Java Library And Calling Its Classes Through Lotus Script And SSJS

Андрей Косинский:

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.

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


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Import a Java library and calling its classes through Lotus Script and SSJS

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×