Part 2 – Learning & Sharing Series

Using JSON –JQuery-java

Good informative links

From Microsoft about JSON

http://msdn.microsoft.com/en-us/library/bb299886.aspx

A clean presentation about JSON

http://www.hunlock.com/blogs/Mastering_JSON_(_JavaScript_Object_Notation_)

Yahoo web services in  JSON

http://developer.yahoo.com/common/json.html

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

http://www.rojotek.com/blog/2009/05/07/a-review-of-5-java-json-libraries/

Mapping Between -Mapping Between JSON And JavaEntities

http://code.google.com/p/json-simple/wiki/MappingBetweenJSONAndJavaEntities

Details about getJSON api

http://api.JQuery.com/JQuery.getJSON/

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——-

Advertisements