3 ms·
"After working through a few issues it's working pretty well." Can you please elaborate so that we can learn from your experience?
by kirubakaran 19y ago
"After working through a few issues it's working pretty well."
Can you please elaborate so that we can learn from your experience?
- tlrobinson 19y agoMostly silly Java things like classpath issues. Also, to get importPackage() you need to do: Scriptable scope = new ImporterTopLevel(context); instead of: Scriptable scope = context.initStandardObjects(); But now I'm having problems getting John Resig's env.js (a browser environment emulator) working because it uses getters and setters, which are new to Rhino 1.6R7. I thought I was using the latest version (it's the one in both JAVA_HOME/jre/lib/ext/js.jar and TOMCAT_HOME/shared/lib/js.jar)
- kirubakaran 19y agoThanks. I don't know Java. So will using Rhino require me to learn at least some?
- tlrobinson 19y agoYeah it helps to know a little Java to get it up and running, but you just need a little glue to get Rhino talking to the servlet and vice versa. Plus if you want to use the Java libraries from JavaScript you at least need to be familiar with the APIs (or know how to look them up in the javadocs) Take a look at Helma if you don't want to deal with all that, it uses Rhino: http://helma.org/ http://helma.org/
- kirubakaran 19y agoThanks for Helma. Which book/website would you recommend to gain the minimum Java knowledge needed to effectively use JS+Rhino?
- tlrobinson 19y agoI don't have any particular recommendations for Java books, probably any of the usual "learn java" style books are ok, it's not a particularly difficult language to learn the basics, but I'd check reviews of books on Amazon or something. I've recently discovered http://www.cafeaulait.org/ http://www.cafeaulait.org/ and it seems like a good Java resource. And of course http://java.sun.com/ http://java.sun.com/