Questions tagged [scriptengine]

Java's ScriptEngine system allows you to run/evaluate statements written in other programming languages like Javascript/ECMAScript, Python/Jython, and Tcl/Jacl.

227 questions
0
votes
1 answer

Convert Object to double Scriptengine

Im using the java scriptengine to evaluate the math of a string i have. import javax.script.ScriptEngineManager; import javax.script.ScriptEngine; public class GraphYPosAlg { public static double YPos(String funktion) { Double tempDouble; …
0
votes
2 answers

Converting String objects into Equations

I'm working on a java program, and one of the tasks I desire it to complete is converting a user given input into an equation that the program will solve. An example would be "(10 + 5 / 3) 2 - 3 (10 * (8 ^ 4))". It has to be able to solve secondary…
user2421021
0
votes
2 answers

access javascript method from java side

I have a javascript resource and apply Rhino Script Engine to call a method from java side. (function( global ){ var Result; (Result = function( val ) { this.tpl = val || '' ; }).prototype = { get: function () …
Tien Nguyen
  • 4,298
  • 9
  • 30
  • 44
0
votes
1 answer

Java ScriptEngine and parent window functions

I am using the Java ScriptEngine to call a JS function from a backing bean under certain conditions in the program. The catch is that the JSF page is running in an iFrame. Although the iFrame is not the real problem at this stage, I want it to be…
MadCharlie
  • 259
  • 1
  • 4
  • 12
0
votes
3 answers

Java 1.5 Script Engine

Since Java 1.6 there is this nice Script Engine Manager which let's i.e. execute JavaScript scripts in run time. Is there something similar in functionality in Java 1.5?
mgamer
  • 13,580
  • 25
  • 87
  • 145
0
votes
3 answers

How To Solve A Basic Math Equation In A String In Java?

I have a basic calculator that is set so when the equal button is pressed then the JTextField is saved in a string form, that's the problem, it's in string form so I do not know how to solve the equation. I've tried using the JavaScript Engine but…
ndfkj asdkfh
  • 316
  • 1
  • 5
  • 15
0
votes
1 answer

How to create a JSON object in Qt using ScriptEngine class?

How to create a JSON object in Qt using ScriptEngine class? So far anybody has tried,Please let me know. Thanks!
tarun
  • 81
  • 1
  • 7
0
votes
4 answers

Add numbers with the word "add"

I am writing to offer an application in Java right now and instead of using the operator "+", the user of the application can literally use the word "add" to add two numbers together. I'm quite stuck on how to do this because I can't really use a…
Twisterz
  • 424
  • 4
  • 15
  • 31
0
votes
1 answer

How to call javascript functions from blackberry native?

I am developing an app where i need to call some methods from blackberry native to javascript. when i click on back key down event , i want to trigger the onBackKeyDown() method, which is declared in javascript. Main.java protected boolean…
code_finder
  • 1,370
  • 2
  • 21
  • 39
0
votes
1 answer

Java ScriptEngine fails for 'long' addition?

I'm using the ScriptEngine to perform calculations specified in a String. I tried a simple program as below: public static void main(String[] args){ ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine engine =…
Aswin Parthasarathy
  • 605
  • 1
  • 8
  • 17
0
votes
2 answers

Calling DOM objects using Java's ScriptEngine or WebEngine classes

Is it possible to modify html elements using the ScriptEngine or WebEngine classes from Java? I've tried the following: /* theSite is a WebEngine object. Assume the id 'Email' is correct */ Element email=(Element)…
Disco Globeulon
  • 459
  • 1
  • 6
  • 16
0
votes
1 answer

ExecutorService thread interval gap for script-engine

Here is the java method to encrypt the entry from a zip file and store it as file. There's no problem with the file reading and writing, so there's nothing to do with line 2-5. the issue is as described below... ExecutorService object (es) used to…
stackunderflow
  • 1,492
  • 1
  • 23
  • 53
0
votes
1 answer

Using Java ScriptEngine to perform multiple evaluation synchronously

how to use a single Java ScriptEngine to perform multiple evaluation synchronously? for example method1 includes sce.eval(code1); method2 includes sce.eval(code2); then the evaluations ran concurrently if both methods synchronized
stackunderflow
  • 1,492
  • 1
  • 23
  • 53
-1
votes
3 answers

Decoding Base64 String in Java

I'm using Java and I have a Base64 encoded string that I wish to decode and then do some operations to transform. The correct decoded value is obtained in JavaScript through function atob(), but in java, using Base64.decodeBase64() I cannot get an…
-1
votes
2 answers

NoClassDefFoundError: org/elasticsearch/script/ScriptEngine

i am new to Elasticsearch. my project is gradle. using those dependencies; implementation('org.springframework.boot:spring-boot-starter-data-elasticsearch') compile group: 'org.elasticsearch.client', name: 'transport', version:…
1 2 3
15
16