rhino

Recursive method 10x slower than interative [closed]

放肆的年华 提交于 2019-12-23 19:08:58
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . The code is cleaned as far as i could to show my problem. Basically its an octree search+intersect. the intersect function comes from an SDK (the whole

scripting in java - javascript from a server-side class file in Java 1.5

ぃ、小莉子 提交于 2019-12-23 04:47:45
问题 I have three types of get requests that are delivered to a class file on web application from a mobile device. Because the mobile device provides no cookies, the log file hit only has in.ter.nal.ip ser.ver.i.p:port 2009-06-05 09:14:44 GET /applicationname/mobiledevicexml reqtype=login&userid=xx### 200 87 - MercuryMobile/1.0 CFNetwork/342.1 Darwin/9.4.1 cookieArrayLength=0; If I can instantiate javascript in my class file, and generate a javascript function call to urchinTracker() from inside

JavaScript engine for Java

江枫思渺然 提交于 2019-12-22 23:34:06
问题 Currently I'm using Rhino in my application. I need to eval some JavaScript ant get values from it (I don't need to use Java classes through JavaScript). But it is too slow. Maybe there are any ways to use V8 with Java application? Update: I have a large collection of objects of different types. I need a flexible mechanism for validation and transformation these objects to the required form (the user should be able to change the rules of validation and transformation (in runtime), ie

JavaScript engine for Java

那年仲夏 提交于 2019-12-22 23:33:11
问题 Currently I'm using Rhino in my application. I need to eval some JavaScript ant get values from it (I don't need to use Java classes through JavaScript). But it is too slow. Maybe there are any ways to use V8 with Java application? Update: I have a large collection of objects of different types. I need a flexible mechanism for validation and transformation these objects to the required form (the user should be able to change the rules of validation and transformation (in runtime), ie

Get variables from javascript expression (Rhino)

喜欢而已 提交于 2019-12-22 07:55:09
问题 I'm using Rhino to evaluate js expressions, by putting all the possible variable values in the scope and evaluating an anonymous function. However the expressions are fairly simple and I would like to put only the values used in the expression, for performance. Code sample: Context cx = Context.enter(); Scriptable scope = cx.initStandardObjects(null); // Build javascript anonymous function String script = "(function () {" ; for (String key : values.keySet()) { ScriptableObject.putProperty

reasonable handling of ScriptException thrown by JSR223 Rhino

寵の児 提交于 2019-12-22 04:56:11
问题 I'm starting to run into the dirty little secrets of what is an otherwise very useful JSR223 scripting environment. I'm using the builtin version of Rhino shipped with Java 6 SE, accessing it through JSR223's ScriptingEngine et al. When I get an exception caused by a Java object I've exported into the Javascript environment, it is a ScriptingException that wraps a sun.org.mozilla.javascript.internal.WrappedException that wraps my real exception (e.g. UnsupportedOperationException or whatever)

Are there any tips & tricks for making rhino perform faster? [closed]

微笑、不失礼 提交于 2019-12-21 00:38:32
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . Are there any tips & tricks for making rhino perform faster? I'm trying to compress a large js file using uglifyJs in Rhino and it

How set classpath for Rhino debugger plugin in Eclipse?

坚强是说给别人听的谎言 提交于 2019-12-20 07:47:38
问题 Actually I am using the Rhino plugin in Eclipse. To use a Java class in JavaScript there is no problem when I just use class which is in RT.JAR. But whenever I want to use my class' "custom classes" then the problem begins due to the classpath. Steps made by me make a class and put it into a JAR file. add it 'jar' into an external JAR file in Eclipse. use it into a JavaScript file and debug it as Rhino debugger in Eclipse. error due to class not defined, "Due to class path is not set properly

How can I specify my own Rhino context in Java?

徘徊边缘 提交于 2019-12-20 03:32:09
问题 I'm trying to ensure that my Rhino scripts (running under Java 6) are strict so that if a script developer misspells an expression I want an exception to be thrown. Currently what happens is the expression simply evaluates to "undefined". Now according to Mozilla org https://developer.mozilla.org/en/New_in_Rhino_1.6R6 there are features to enable strict checking in the context. I cannot find a working example of this. What I did so far was write a class to extend ContextFactory and then

Launch jsdom from Rhino on Java

点点圈 提交于 2019-12-19 10:22:50
问题 I'm following up on this answer: I managed to run simple JavaScript code from Rhino Engine on Java. But when it comes to D3.js, for example: var svg = d3.select("body").append("svg") as you can see d3 requires DOM to be available on first place. So, for that reason JSDOM is supposed to be the solution. But JSDOM happens to be depended on requirejs From RequireJs site: The r.js file allows you to run the optimizer as well as run modules in Node, Rhino or xpcshell. Then my Java Rhino code look