close
Showing posts with label JSON. Show all posts
Showing posts with label JSON. Show all posts

Monday, 13 May 2013

Spring MVC, Ajax and JSON Part 3 - The Client Side Code

If you’ve been following this short series of blogs on Spring, Ajax and JSON you’ll recall that I’ve got as far as creating a Spring MVC web application that displays a form, which allows the user to select a bunch of items and submit a request to the server to purchase them. The server then replies with some JSON allowing the user to confirm their purchases. If you already know all this you can now jump to HERE. If you’re wondering what I’m talking about then take a look at the first two blogs in this series:


HERE


Having completed the server side code then the next thing to do is to move on to the client side code,

Monday, 6 May 2013

Spring MVC, Ajax and JSON Part 2 - The Server Side Code

In my last blog I said that I was going to talk about Spring, Ajax and JSON, but didn't. The reason for this is that I wanted to set the scene using a (barely) credible shopping web site scenario. In this scenario when the user clicks on the eCommerce page link, the server app loads some the items from a catalogue and displays them on the page. The user then checks a number of items and presses 'Confirm Purchase'. Now, this is where Ajax and JSON come in, on pressing 'Confirm Purchase' the browser makes an Ajax request to the server sending it the item ids. The server then retrieves the items from the database returns them as JSON to the browser. The browser then processes the JSON, displaying the items on he screen.

My last blog got as far as creating and displaying a form that presented a list of items from the imaginary catalogue to the user. This blog takes a look at the next step in the project: creating some JSON.

Monday, 29 April 2013

Spring MVC, Ajax and JSON Part 1 - Setting The Scene

I've been thinking about writing a blog on Spring, Ajax and JSON for a good while, but I've never got around to it. This was mainly because it was quite complicated and the technique required has been in a state of flux. When I decided to write this blog, I had a scout around the Internet and if you look on places such as Stack Overflow you'll see many different and often contradictory answers to the question "how do I write a Spring Ajax/JSON application?" I think that this is fault of the Guys at Spring in that they've been really busy improving Spring's support for JSon; not only that the Guys at JQuery have also been busy, which means that overall things have changed dramatically over the last couple of years and the answers to this "how do I write a Spring Ajax/JSON application?" are out of date.

Tuesday, 2 April 2013

Just What Are Spring 3.2 Matrix Variables? - Part 1

Spring 3.2 introduced support for processing something called 'Matrix Variables' and probably like most developers, I've never heard of them. So, after some research, this blog is my understanding of what they are and what you can do with them. As usual, please feel free to correct me if I'm wrong.

When I first read about them a whole bunch of questions came to mind, for example:

  • What are they?
  • Why use them?
  • Why do the Guys at Spring think they're important?
  • Why now?

Friday, 5 August 2011

The Spring MVC-Ajax Sample and its JSON Library

The Spring-MVC sample code is available from the Spring subversion repository at https://src.springframework.org/svn/spring-samples. The idea of this sample is to demonstrate a simple Ajax application that updates an account screen both checking that a user name is available and adding a new account to the application.

Thursday, 16 June 2011

The Difference Between JSON and XML

A few days ago I did a blog Comparing XML and JSON. Today I will be illustrating the difference between JSON and XML using a simple coding example. So, straight to the point: XML is human-readable data interchange specified in a document format, whilst JSON is human-readable data interchange data format.

Tuesday, 14 June 2011

Maven POM Settings for JSON APIs

Having talked about JSON and XML yesterday, I mentioned that there are a number of successful APIs available for both data interchange systems. The two APIs I’ve used for JSON are JSON in Java available from the JSON website and the JSON-Simple API from Google.

Monday, 13 June 2011

Comparing XML and JSON

There seem to have been, at various times, some argument about which open standard for human-readable data interchange is best: JSON or XML. This blog takes a look at these two standards and compares the two,