Example usage for org.springframework.web.servlet.view.json MappingJackson2JsonView setPrettyPrint

List of usage examples for org.springframework.web.servlet.view.json MappingJackson2JsonView setPrettyPrint

Introduction

In this page you can find the example usage for org.springframework.web.servlet.view.json MappingJackson2JsonView setPrettyPrint.

Prototype

public void setPrettyPrint(boolean prettyPrint) 

Source Link

Document

Whether to use the default pretty printer when writing the output.

Usage

From source file:com.cami.view.resolver.JsonViewResolver.java

@Override
public View resolveViewName(String string, Locale locale) throws Exception {
    MappingJackson2JsonView view = new MappingJackson2JsonView();
    view.setPrettyPrint(true);
    return view;/*from   www.  j  av a 2  s.  c  om*/
}

From source file:spring.travel.site.view.JsonViewResolver.java

@Override
public View resolveViewName(String viewName, Locale locale) throws Exception {
    MappingJackson2JsonView view = new MappingJackson2JsonView();
    view.setPrettyPrint(true);
    return view;//from   w  ww .ja  v a 2 s. c  o  m
}