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?
XMLHttpRequest in Rhino?
Asked Answered
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
You practically need to define XMLHttpRequest in Java. And it is already done - check this out.
See docs.oracle.com/javase/6/docs/technotes/guides/scripting/…, section "Importing Java Packages, Classes" –
Monia
© 2022 - 2024 — McMap. All rights reserved.