I'm attempting to filter a FreeMarker list in a Magnolia JavaScript model using Array.prototype.filter().  List  [#assign list = [1, 2, 3]]   Model  var Model = function() {   this.filterList = function(list) {     return list.filter(function(ite...
In Java 1.7, prior to it's removal, one could use 'Packages' to access Java Enums in the following way from Javascript on an HTML page viewed a browser:  var enumvar1 = document.appletid.Packages.com.mycompany.MyClass$MyEnumYesNo.YES var...
I need to evaluate this function in Javascript from Scala/Java  function hello(a, b) {     return a+b; }   I did this basic code:  val factory = new ScriptEngineManager(null) val engine = factory.getEngineByName("JavaScript")  val body =   &#...
I want to render d3 charts on the server.  I had 3 options:  Node, Phantom, and Nashorn.    I prefer Nashorn because my API is Scala Play and I don't want to manage another process.  (deployment, load, queue, etc etc)  So now I need to get JSDom...
I am trying to write a library that will let me execute JSON Logic rules via the Nashorn Javascript engine.  My problem right now is specifically around the JSObject wrapper I've created to handle moving data from Java/Kotlin into the scripting e...
I have evaluated the following script using the NashornScriptEngine:  var Namespace = {     test: function()     {         return "It works";     } }   Now I want to call the function test.  When using the method invokeFunction of the nashorn...
Java calling code:  import jdk.nashorn.api.scripting.*; .... myCustomHashMap dataStore = new myCustomHashMap(); ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine engine = sem.getEngineByName("nashorn"); engine.put("dataSto...
While running below code, I am getting error. I have no idea what is causing this error.  ScriptEngine engine = engineManager.getEngineByName("nashorn");       String str = "var shape_objects = [ Java.Type(\"new Triangle()\"), Jav...
I am currently creating a plugin for the Bukkit-Server, but i have a problem using the Nashorn scripting engine. I am evaluating the external javascript file from my Java-Plugin. I cant get my javascript to import the classes from my plugin, only sta...
Assume the following API:  package nashorn.test;  public class API {      public static void test(String string) {         throw new RuntimeException("Don't call this");     }      public static void test(Integer... args) {         System...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.