Topic
  • 1 reply
  • Latest Post - ‏2012-04-15T16:18:44Z by SystemAdmin
SystemAdmin
SystemAdmin
570 Posts

Pinned topic How to import my java library to server-side scripting?

‏2012-04-10T19:56:59Z |
I have a jar file that I need to use to access custom code during some function executions inside my WL adapter.
adapter.xml

<procedure name="getMyList"/>

adapter-impl.js

function getMyList() {
var SF = MyListClass.StaticList();

return SF

}

MyListClass class is inside a jar that I want to use.
Assume this class is inside a myUtilityLib.jar file.
How to import this class into the adapter java script?
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: How to import my java library to server-side scripting?

    ‏2012-04-15T16:18:44Z  
    Your JAR must be in the lib folder.

    if it is a static object you can do it this way:

    var x = com.foo.bar

    function test() {
    return x.getUserName();
    }

    if it is not a static object you need to use new to create it.