Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I use ScriptEngineManager in EJB?

Bupjae Lee
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is javadoc for javax.script.ScriptEngineManager consturctor:

public ScriptEngineManager()

If the thread context ClassLoader can be accessed by the caller, then the effect of calling this constructor is the same as calling ScriptEngineManager(Thread.currentThread().getContextClassLoader()). Otherwise, the effect is the same as calling ScriptEngineManager(null).

public ScriptEngineManager(ClassLoader loader)

This constructor loads the implementations of ScriptEngineFactory visible to the given ClassLoader using the service provider mechanism.

If loader is null, the script engine factories that are bundled with the platform and that are in the usual extension directories (installed extensions) are loaded.

However, I know that using ClassLoader is prohibited in the EJB.

Then, the only choice - new ScriptEngineManager(null) - would be work?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic