i have writen a servlet that recives a java script code and process it and returns the answer. for that i have used the java scripting API
in the code below if scrip
Nashorn scripts are compiled to .class "files" & loaded on the fly. So, script evaluation is similar to loading a compiled Java .class and running the same. Unless you program explicitly for interruption, you can't stop script evaluation. There is no "script interpreter" that "polls" for interrupt status. You've to explicitly call Thread.sleep or other Java API that be interrupted from another thread.