Spring MVC: REST application with CNVR vol. 1

Not so long time ago I have read an article written by Paul Chapman about Content Negotiating View Resolver (CNVR). That post on a Spring Framework Blog inspired me to investigate this framework’s area. As a result I have developed a sample REST application based on Spring MVC with CNVR. The application demonstrates a basic flow of a REST service – creation, deletion, reading and edition of an entity.

Spring Framework supports REST services for a long time, earlier you could develop some service using Message Converters. In Spring 3.2 all this stuff become more easier in configuration and development. So lets stop talking because I’m going to show a basic setup and exploitation of Spring REST service with CNVR.

A basic idea of CNVR is to define which kind of representation form for a resource give back to a client depending on information which CNVR gets from the client’s request. You can ask me: what is that information in the request which can impact on CNVR decision? The answer is simple:

  • URL sufix (e.g. .xml, .json, .html etc
  • URL parameter (

Source : http://www.javacodegeeks.com/2013/07/spring-mvc-rest-application-with-cnvr-vol-1.html

Back to Top