title: Jackson's @JsonView, @JsonFilter and Spring
body: <p>Can one use the Jackson <code>@JsonView</code> and <code>@JsonFilter</code> annotations to modify the JSON returned by a Spring MVC controller, whilst using <code>MappingJacksonHttpMessageConverter</code>and Spring's <code>@ResponseBody</code> and <code>@RequestBody</code> annotations?</p>
  
  <pre><code>public class Product
  {
      private Integer id;
      private Set&lt;ProductDescription&gt; descriptions;
      private BigDecimal price;
      ...
  }
  
  
  public class ProductDescription
  {
      private Integer id;
      private Language language;
      private String name;
      private String summary;
      private String lifeStory;
      ...
  }
  </code></pre>
  
  <p>When the client requests a collection of <code>Products</code>, I'd like to return a minimal version of each <code>ProductDescription</code>, perhaps just its ID. Then in a subsequent call the client can use this ID to ask for a full instance of <code>ProductDescription</code> with all properties present.</p>
  
  <p>It would be ideal to be able to specify this on the Spring MVC controller methods, as the method invoked defines the context in which client was requesting the data.</p>