Hello Amal, This issue has been already reported under following jira[1]. [1] https://wso2.org/jira/browse/ESBJAVA-3423
Thanks & Regards. Kamidu Sachith Punchihewa *Software Engineer* WSO2, Inc. lean . enterprise . middleware Mobile : +94 (0) 770566749 <%2B94%20%280%29%20773%20451194> Disclaimer: This communication may contain privileged or other confidential information and is intended exclusively for the addressee/s. If you are not the intended recipient/s, or believe that you may have received this communication in error, please reply to the sender indicating that fact and delete the copy you received and in addition, you should not print, copy, retransmit, disseminate, or otherwise use the information contained in this communication. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. On Fri, Aug 7, 2015 at 11:24 AM, Hasitha Amal De Silva <[email protected]> wrote: > Hi, > > Whats the best way to do $subject ? > > The primitive way is to use > > var obj = eval("(" + jsonStr + ')'); > > but thats vulnerable to executing anything other than simple JSON. > > I did find a lot of samples using > > JSON.parse(jsonStr) > > But when trying this out, ESB fails to identify JSON module within the > script mediator. > > Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "JSON" is not > defined. (<Unknown source>#1) > at > org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350) > at > org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340) > at > org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3413) > at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1612) > > Please advice. Are there any other in-built functions that can be used ? > > -- > Cheers, > Hasitha Amal De Silva > Software Engineer > Mobile : 0772037426 > Blog : http://devnutshell.tumblr.com/ > WSO2 Inc.: http://wso2.com ( lean.enterprise.middleware. ) > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
