ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Validate if a given String is JSON

vsony7
5 Feb 2012 03:26:49 GMT
5 Feb 2012 03:26:49 GMT

Hi,

Is there a ZK library which allows me to validate if a given String is of valid JSON format?

For e.g, say I enter some text into a textbox and hit enter(ON_OK event), I am trying to validate if the value of textbox is in valid JSON format.

Thanks

vsony7
5 Feb 2012 03:39:39 GMT
5 Feb 2012 03:39:39 GMT

Hi,

I just figured ZK Provides API for JSON. The following code works in Java.

            try {
                JSONValue.parse(input);
            } catch(Exception e) {
                // Not a valid JSON
            }

dennis
6 Feb 2012 04:58:54 GMT
6 Feb 2012 04:58:54 GMT

search "json format validate java" in google, you will find some solution.