Unable to call javascript methods

64 views
Skip to first unread message

shrutika ukey

unread,
Apr 12, 2018, 1:35:53 AM4/12/18
to mozilla-rhino
I have requirement to execute javascript method (which does some reporting and dump a PDF file) from java class.

Facinng issue on how to load the context path in java method and call js method directly from java.

Eg. I need the context path of js file like /webapp/js/orn/workflow/Engine.js same as we get from browser in my java class :-  ocm\src\main\java\com\interra\orion\util\workflow\ScriptEngineUtil.java

Any thoughts on how to proceed



Gregory Brail

unread,
Apr 20, 2018, 12:21:17 PM4/20/18
to mozill...@googlegroups.com
Not sure exactly what you're asking here. Are you asking what's the best way to locate the JavaScript source file that you want to run using Rhino? In that case, in Java I find it's sometimes helpful to use the classloader and the Class.getResourceAsStream() method, which will let you read any resource files that you put in your JAR. Or are you wondering how to invoke Rhino? In that case, the "Embedding Rhino" doc at the Mozilla site is still helpful:



--
You received this message because you are subscribed to the Google Groups "mozilla-rhino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-rhin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages