tags:

views:

786

answers:

1

Hi,

With Lotus Domino 8.5.1, one can use "standard" Java classes into server side Javascript (embedded into an Xpage), or Java classes available in the WEB-INF/lib folder. For example :

var driverClass:java.lang.Class;
var driver:java.sql.Driver;
var connection:java.sql.Connection;
var statement:java.sql.Statement;
driverClass = java.lang.Thread.currentThread().getContextClassLoader().loadClass("org.gjt.mm.mysql.Driver");
driver = driverClass.newInstance();

(sample found here here)

However, how could one use our own custom classes defined in Java script libraries ? In an Xpage, one can only import server side javascript libraries (not Java nor LS ones).

Thanks for your help

Cheers

+2  A: 

Answer found on the wiki :

http://www-10.lotus.com/ldd/ddwiki.nsf/dx/reuse%5Fjava%5Fxpage.htm

From an XPage it is easy to call Service Side JavaScript for business logic. The JavaScript has built in features that enable it to call Java. Unfortunately Server Side JavaScript, as used by XPages, cannot currently call Java routines created in a Java library. However it can call into a Java library that has been exported as a JAR file. As it turns out you can also create a Java library that also calls into a Java JAR file.

Olivier BOISSIN