rhino

Use a specified javascript engine?

Is it possible to use your own javascript engine in place of the browser's engine? We have a cloud based JAVA app and uses a lot of javascript and ajax. I don't know a ton about Java (just enough to get by), I'm an ajax programmer. Mozilla has a javascript engine called rhino. Is that engine only for running javascript inside a native...

Build a JS server inside of Java for Google AppEngine

Hi, I just needed to create a little interface for a project. So I decided to take given code and to run it on Google AppEngine. My problem is, that I'm experienced in JavaScript and got some basic knowledge of Java, but I got no clue how a Java webapp has to be structured. I started Eclipse and installed the AppEngine-addon, downloaded...

Call a (Rhino) JS function in Java and pass a variable in

Hi, after figuring out yesterday how to configure my Eclipse project to be able to run JS code (if your interested: http://stackoverflow.com/questions/3417958/), I have the next question related to this topic: I got a JS file and a function within it. I need to run that function inside my Java code and to pass a (Java string) variable i...

example using rhino's JavaAdapter

Hi Can someone provide me an example on how to extend a java class in java script using Rhino's java adapter ? ...

How do I call a method of a Java instance from JavaScript?

I'm using the Mozilla Rhino JavaScript emulator. It allows me to add Java methods to a context and then call them as if they were JavaScript functions. But I can't get it to work except when I use a static method. The problem is this part of the documentation: If the method is not static, the Java 'this' value will correspond to the...

How to use javas built-in javascript engine to run script on a web-page?

Hi, I want to show lyrics for songs in my player. I used to use lyricsplugin.com because it had a lot of English and Russian lyrics, but recently they've changed their web-site from being a static page to an ajax-powered page. Searching lyrics follows this pattern: http://www.lyricsplugin.com/winamp03/plugin/?artist=Linkin%20Park&ti...

Importing a map in javax.scripting javascript environment.

I'm seeing some odd behavior in the javax.scripting map implementation. The online examples show an example of adding to a list within the js environment: ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine jsEngine = mgr.getEngineByName("JavaScript"); List<String> namesList = new ArrayList<String>(); namesList.add...

best way to run narwhal under linux

I'm checking out narwhal. It seems pretty cool, and I'm particularly impressed with the tusk package management system. However, since narwhal runs under rhino, the usefulness of this command-line tool is impinged upon by the JVM's obscene startup times. I'm aware of narwhal's ability to run under different engines, but it's unclear w...

using recent Rhino in ant script

I'm trying to use a recent version of Rhino in an ant tag, but it seems to be using the version of Rhino that comes bundled with the JVM instead. I've tried adjusting the classpath to specify the Rhino script jar. Currently, I've tried the following: <project default="hello" name="hello-world" basedir="."> <target name="hello"> ...

Rhino load() function available in JavaScript provided by javax.script?

Some JavaScript files that have been developed for Rhino's shell use load() to load additional JavaScript files. I'm attempting to embed functionality from one of these Rhino JavaScript files using javax.script. Unfortunately, the load() function is not implemented by javax.script's JavaScript. When attempting to eval() a script containi...

rhino vs spidermonkey

I noticed ubuntu 10.04 removed the spidermonkey package. Rhino looks like it's still there though. What are the differences between rhino and spidermonkey (besides what language they're written in). And why did they remove spidermonkey? ...

How do i check if an instance of the form already exists?

Im developing a plugin for Rhino, and when i run the command starting plugin i carries out the following. It creates a splash form, which has a timer on it, and after 2sec i loads another form. If i by mistake click the plugin-icon again, it creates another instance of the spash form, which loads the plugin again. How do i prevent thi...

Can't figure out why this Rhino Mock is failing? Error: Expected True, But Was: False

Here is the code: public interface IAccessPoint { int BackHaulMaximum { get; set; } bool BackHaulMaximumReached(); void EmailNetworkProvider(); } public class AccessPoint : IAccessPoint { public int BackHaulMaximum { get; set; } public bool BackHaulMaximumReached() { if (BackHaulMaximum > 80) ...

Unity Nunit & Rhino Mocks

Hi, could anyone give me a good example of using rhino mocks, nunit, and unity together. I am reading the help on each but there doesnt seem to be any good sample projects of how you would use them together and the way to set up projects /test projects using them. I.e. do you create new ioc containers in your test project which point t...

Fastest scripting language for Java?

I'm making a falling sand game in Java. I want users to be able to write their own engine for the game and I thought a scripting language might work for that. I've tried out a small script with jython and it's many times slower than that java version. I need a scripting language that has fast loops and/or fast array access since that's ...

How to compile rhino/javascript files to .class bytecode for java at runtime

I'm making a falling sand game in Java. I want users to be able to write their own engine for it using a simpler language. Falling sand games can be very CPU intensive so I want to have the engine running as fast as possible while not having to manually compile. I need to know how to compile rhino javascript files to .class files by at ...

In javascript, how can you assert that two items are equal?

I am running Rhino and trying to determine how to do an assert_equals() or its equivalent in Javascript. From the Rhino shell I can load qunit, but I can't create an assertion that will fail. What is the easiest way to use assertions in Javascript? I will be using Javascript in environments other than a web browser, so knowing how to d...

Problems using Rhino on Android

Hi, I'm trying to use Mozilla Rhino in my Java application for Android to evaluate some JavaScript. I am using Eclipse + ADT plugin. First I tried simply downloading the Rhino .jar file from Mozilla's website and adding it to the project as a library in Eclipse. Eclipse recognised it fine and compiled the application. However, when run...

Differences between Narwhal and Node.js?

I'm new to Node.js and I have been reading about Narwhal that is a framework based on Rhino. My questions: If I'm using Node.js, should/could I use Narwhal and it's libraries/modules? Aren't the libraries/modules in Narwhal IO-blocked (why Node.js got this huge popularity)? Is Node.js only for creating Web servers or is it for creatin...

rhino licensing problem

Hi I have not well understand how rhino license works. I would like make a commercial application (desktop) and embedding rhino to make available javascript to my users for easy customizing the application. according license there's seems there's no probs I only should print in copyright rhino notice.. http://www.mozilla.org/rhino/dow...