2

I am trying to make an XS project in HANA which will use some of the classes and methods that can be found in a .jar file. These classes and methods will do some calculations and present it to the user in the UI.

The question is: How do I access methods and classes of that .jar file?

I have registered it as an external library, but I have no idea how to call it from my XS javascript source files.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
hana_fan
  • 21
  • 3

3 Answers3

2

there's no way to invoke external .jar package from XS's server-side JavaScript. You can use an external library using function "$.import", but this is only valid for JavaScript library.

zhaow
  • 83
  • 5
2

XS Server does not and will not support Java. Only Javascript...

sestevez
  • 21
  • 2
1

If you want to outsource some of your xsjs functions to an external library, xsengine provides a special format for this, called ".xsjslib". You can import a library using the following code:

$.import("<package_your_library_was_deployed>","yourLib");

access functions inside your lib by this path:

$.path.to.your.library.filename.yourFunction();
AHaberl
  • 328
  • 2
  • 12