11:39 am - Saturday March 25, 2017

Archive: Z-A JSON codes Subscribe to Z-A JSON codes

JSON Array With JSP

Project Structure:              JARFiles:        JSONArrayJsp.jsp: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="org.json.JSONArray,org.json.JSONException"%> <!DOCTYPE...

JSON Object With JSP

Project Structure: JARFiles:        JSONObjectJsp.jsp: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="org.json.JSONObject,org.json.JSONException,java.util.*"%> <!DOCTYPE...

JSON Array With Servlet

ProjectStructure:                    JarFiles:         Array.java: package com.candidjava; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import...

JSON Object With Servlet

ProjectStructure:                   JarFiles:          JObject.java: package com.candidjava; import java.io.IOException; import java.io.PrintWriter; import java.util.Iterator; import javax.servlet.ServletException; ...

JSON Array With JavaScript

Project Structure:             JsonArrayJs.html: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <h1>This is JSON Example</h1> <script...

JSON Object With JavaScript

Project Structure:             JSONObjectJs.html: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <h1>This is JSON Example</h1> <script...

JSON Tokener With JAVA

JSONTokener: JSONTokener class allows an application to break a string into tokens. Methods: next – This method returns a character next to current position. back – It moves cursor one position back. more – It returns true if the token...

JSON Array With JAVA

JsonArray: JSONArray holds values. It is an ordered value. It supports any data types (Boolean,Number,JSONArray,JSONObject,String). Syntax: JSONArray array=new JSONArray(); array.put("value"); Another Format: Its external form is...

JSON With java

JSON + JAVA + Object   

JSON Object With JAVA

JsonObject: Json object holds key and value pairs. It is an unordered collection of key and value pairs. Key and values are separated by commas. It supports any type of values (numeric, string, object, etc) Syntax: JSONObject object=new JSONObject();</pre> object.put("key","value"); Another...

Advantage and Disadvantage of JSON

Advantages: JSON is light weight component. It doesn’t take more time for execution. It supports data structures used in modern languages. In Java script we cannot retrieve values from other files for example java. In JSON we can retrieve...

What is JSON?

Java Script Object Notation is a text based format for exchanging data. JSON is human readable format. JSON is language independent. It is light weight component. It doesn’t need any compilation process to execute it. It supports many languages....