XMLHttpRequest in Rhino?
Asked Answered
E

1

8

Lately I have been playing around with Java's ScriptEngine API, namely the javascript engine, which uses Rhino for everything.. I sumbled upon the fact that Rhino has no XMLHttpRequest. I was wondering if anyone knew of a possible way around this?

Ehlke answered 21/12, 2012 at 6:50 Comment(1)
Using XMLHttpRequest is a good idea because it's familiar to most people who use JavaScript, but it's not actually necessary in Rhino. You can use any of the Java network classes directly (in fact, that's how you would implement XHR in Rhino).Kermie
M
14

You practically need to define XMLHttpRequest in Java. And it is already done - check this out.

Monia answered 21/12, 2012 at 7:32 Comment(1)
See docs.oracle.com/javase/6/docs/technotes/guides/scripting/…, section "Importing Java Packages, Classes"Monia

© 2022 - 2024 — McMap. All rights reserved.