What is Spring-Json View?

Spring-Json View adds JavaScript Object Notation (JSON) support to Spring-MVC. It is deeply integrated into the Spring-MVC module and can be used with a variety of standard controllers.

In the J2EE world Spring-MVC has become a popular model-view-controller framework for web applications providing better separation of concerns than the older Struts framework. In this age of Web 2.0 Ajax is a commonly used to communicate between clients (typically Browsers) and servers. When we looked for a way to use our Spring-MVC knowledge to create Ajax request targets there was nothing that could satisfy a fastidious Spring-MVC developer so we started to think about a Spring Json view which supported all Spring-MVC features.

Features

Configuration
It can be configured the Spring way!
Binding
Supports the Spring way by converting bean property values for the view. (Please see the initBinder() method of the SimpleFormController)!
Integration of common Json generators
Currently supports SOJO by default, the JSON-lib and XStream.
Validating
Supports validation by ValidatorBeans!
Errorhandling
It supports Spring error handling including global, field and binding errors!
Exceptionhandling
Exception handling using a JsonExceptionResolver!

This way you are able to swap a "classic" Spring application for a Web 2.0 application by just changing the view while keeping the back-end unchanged.

Alternatives?

There are other projects which aim to provide Spring-MVC with Json capabilities. For example the Json-lib4Spring project which like Spring-Json builds on the JSON-Lib library.

Status

NEWS
Demoapplication is provieded as Application at GAE (Google Application Engine)

Take a look at http://spring-json-demoapp.appspot.com/