You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 29, 2020. It is now read-only.
I am running a little script importing a static class using this library as dependency on my Java 11 project. The return type of the function is object instead of a string how it used to be on my old project version using the Java 7 embedded Rhino Script Engine. So, I need to cast every function return to String in order to use the prototype functions of String.
try {
var ImportedClasses = JavaImporter(com.StringUtils);
with (ImportedClasses) {
var text = 'Test text';
document.write ('<br>typepf text: '+typeof text+'<br>');
var shouldBeString = StringUtils.methodReturningString ();
document.write ('<br>typepf shouldBeString: '+typeof shouldBeString+'<br>');
}
}
catch (e) {
document.write (e);
}
I am running a little script importing a static class using this library as dependency on my Java 11 project. The return type of the function is object instead of a string how it used to be on my old project version using the Java 7 embedded Rhino Script Engine. So, I need to cast every function return to String in order to use the prototype functions of String.
This script will print the following:
typepf text: string
typepf shouldBeString: object