Parsing JSON via ScriptEngine in the JDK

I’m writing some REST WebServices that return JSON and wanted to ensure that my JSON was correctly formatted and parsable. Since the JDK ships with a JavaScript engine built into it now, I figured it would be simplest to just use that and avoid any external dependencies. Here’s my code: ScriptEngine se = new ScriptEngineManager().getEngineByExtension(“js”); […]