Tivoli Directory Integrator, Version 7.1.1

Java and JavaScript

In JavaScript you can access Java objects. This is very useful, because all the IBM® Tivoli® Directory Integrator internal objects are Java objects.

However, there is a pitfall when some of the Java Objects have methods with names that are reserved words or operators in JavaScript. In these cases, the JavaScript interpreter tries to process the reserved word instead of calling the Java method.

Such an example can be found with the java.io.File class which has a delete method. delete is also a JavaScript operator, so the following call fails:

var myFile = java.io.File("file.txt"); myFile.delete();

Instead, you can do one of the following calls:

[ Top of Page | Previous Page | Next Page | Contents | Terms of use | Feedback ]
(C) Copyright IBM Corporation, 2003, 2012. All Rights Reserved.
IBM Tivoli Directory Integrator 7.1.1