Tag Archives: json

Android Receiving JSON Data from REST Service

android-http-get-jsonMost Internet services will serve “send” you the data you requested “using HTTP GET/POST request” in JSON format. If your Android app is depending on sending and receiving data over the Internet e.g. interacting with social network API, you will definitely need to deal with JSON formatted data in your apps. This article shows how to send HTTP GET request to a rest service that returns data in JSON format & how to parse received JSON data.

Continue reading

Java Servlet Send & Receive JSON Using jQuery.ajax()

This is a complete example showing how to send jQuery.Ajax() POST request containing data in JSON format to the server, and how to receive this JSON content, parse it and map it into Java objects in the server “servlet” side. Also, we will see how to send the list of all received data back to the client in JSON format and how the client can parse this data and display it.

java-servlet-json

Objectives:

  • How to send jQuery.ajax() POST request with data in JSON format?
  • How to receive JSON data in Java servlet, parse it and map it into Java objects?
  • How to send data back to the client in JSON format too?

Continue reading

Java Servlet – jQuery File Upload (multiple, drag&drop, progress…)

jQuery-File-Upload js library is “so far” the most elegant, smart, simple..etc js library I have used to upload files. Simply it is amazing. It supports async upload “Ajax”, multiple files upload, drag&drop, progress update and a lot more. Here we will see how to upload multiple files to Java “Servlet” app and how to deal with uploaded files using Java Servlet API or Apache FileUpload Library. Bootstrap has been used in this example to make the UI more attractive.

servlet-jquery-file-upload

Objectives:

Continue reading

Jackson – Java to JSON & JSON to Java

Converting Java objects to JSON and JSON to java objects is a common function in most apps. Jackson is a Java library that enables you to do so easily.

jackson-java-json

Objectives:

  • How to convert Java object into JSON and back again to Java?
  • How to convert between Generic collection and JSON?
  • How to build Java tree model for JSON?
  • How to configure Jackson using annotations?

Continue reading

Spring MVC + rest.js

This post is about building a RESTfull client using rest.js which belongs to cujo.js family.

If you want to build SPRING MVC REST application without using rest.js look at these posts

Objective:

  • Build RESTfull HTTP “browser” client using rest.js! “it is interesting how javascript made it out of the browsers!”

Continue reading