I was wondering how to import my java packages into a js file and then call class methods on created object.
The reason I need to import is I wish to get data from a connection to my database, regarding dates and I have a class that lets me do so. So I need to import the Package, then create a class object, then call methods on my object.
I would appreciate your help, Thank you, John
The questions does not specify that this is a browser-based question. Java ships with Rhino since version 6. So, on the off chance that someone wants to know how to do this - e.g., using JavaScript as a scripting language for 3rd party tools like soapUI or PTC Integrity - it's incredibly simple.
importPackage(java.io);
Check out Wikipedia:Rhino (JavaScript engine) as a good starting point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With