Part 2 – Learning & Sharing Series

Using JSON –JQuery-java

Good informative links

From Microsoft about JSON

A clean presentation about JSON

Yahoo web services in  JSON

This is a good link to select between different JSON available Libraries in java

Mapping Between -Mapping Between JSON And JavaEntities

Details about getJSON api

Software Used

Json-simple java Library

NetBeans 6.8

JQuery 1.8

Tried the following

1. A simple JSON communication using JQuery and JSP on the server side

2. Using yahoo services with JQuery

A simple JSON communication  using JQuery and JSP on the server side

Made a Simple Server side JSON output using json-simple java Library –

Details about AliceintheWorderland film as JSON output

Used JQuery function getJSON  for parsing the JSON output

The browser output appeared like this

Added an Actors array list to the JSON output

Accessed the URL directly outputs in the browser window like this

The browser output with Actor details

2. Using yahoo services with JQuery

Yahoo web services have  an option to prefer the output format with in JSON/XML

Tried using the yahoo answers web services

In browser the JSON output of yahoo answers service appeared like this – Queried for ipad in yahoo answers

Initially used JQuery get method to test the access and parsing

Once the above step worked tried using the getJSON function

The output appeared in the browser window as follows

— Thanks for your time——-