0

I want to know the limitation(s) when executing code using Java Scripting API (JSR223) for example using Beanshell or groovy language,

What can't be done/execute using the language chosen as groovy? Is there some language capabilities that can't be used inside script?

1 Answer 1

1

The java scripting API uses AccessController.doPrivileged() to run the script, so depending on context there are could be any restrictions done.

For example restricted access a file system...

Sign up to request clarification or add additional context in comments.

2 Comments

are there also language limitation? e.g. can't use static compilation, can't use keyword, etc...
groovy executed as a script. groovy script before running converted into a class. all the code (except methods/functions) executed as a method main in java. and you can't declare static variables inside the method. but you can declare inner class with static vars in groovy script like: class MyConst { static int i = 123 } and access it from script: MyConst.i

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.