本文整理匯總了Java中org.springframework.web.servlet.view.json.MappingJackson2JsonView.setPrettyPrint方法的典型用法代碼示例。如果您正苦於以下問題:Java MappingJackson2JsonView.setPrettyPrint方法的具體用法?Java MappingJackson2JsonView.setPrettyPrint怎麽用?Java MappingJackson2JsonView.setPrettyPrint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.web.servlet.view.json.MappingJackson2JsonView
的用法示例。
在下文中一共展示了MappingJackson2JsonView.setPrettyPrint方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDelegatedView
import org.springframework.web.servlet.view.json.MappingJackson2JsonView; //導入方法依賴的package包/類
private static MappingJackson2JsonView createDelegatedView() {
final MappingJackson2JsonView view = new MappingJackson2JsonView();
view.setPrettyPrint(true);
view.setDisableCaching(true);
view.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);
return view;
}
示例2: createDelegatedView
import org.springframework.web.servlet.view.json.MappingJackson2JsonView; //導入方法依賴的package包/類
private static MappingJackson2JsonView createDelegatedView() {
final MappingJackson2JsonView view = new MappingJackson2JsonView();
view.setPrettyPrint(true);
view.setDisableCaching(true);
view.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).findAndRegisterModules();
return view;
}
示例3: resolveViewName
import org.springframework.web.servlet.view.json.MappingJackson2JsonView; //導入方法依賴的package包/類
@Override
public View resolveViewName(String viewName, Locale locale) throws Exception {
MappingJackson2JsonView view = new MappingJackson2JsonView();
view.setExtractValueFromSingleKeyModel(true);
view.setPrettyPrint(true);
return view;
}
示例4: resolveViewName
import org.springframework.web.servlet.view.json.MappingJackson2JsonView; //導入方法依賴的package包/類
/**
* Get the view to use.
*
* @return Always returns an instance of {@link MappingJackson2JsonView}.
*/
@Override
public View resolveViewName(String viewName, Locale locale)
throws Exception {
MappingJackson2JsonView view = new MappingJackson2JsonView();
view.setPrettyPrint(true);
return view;
}
示例5: resolveViewName
import org.springframework.web.servlet.view.json.MappingJackson2JsonView; //導入方法依賴的package包/類
/**
* Get the view to use.
*
* @return Always returns an instance of {@link MappingJacksonJsonView}.
*/
@Override
public View resolveViewName(String viewName, Locale locale) throws Exception {
MappingJackson2JsonView view = new MappingJackson2JsonView();
//view.setObjectMapper(objectMapper);
view.setPrettyPrint(true); // Lay the JSON out to be nicely readable
return view;
}
示例6: resolveViewName
import org.springframework.web.servlet.view.json.MappingJackson2JsonView; //導入方法依賴的package包/類
@Override
public View resolveViewName(String viewName, Locale locale) throws Exception {
MappingJackson2JsonView view = new MappingJackson2JsonView();
view.setPrettyPrint(true);
return view;
}
示例7: jsonTemplate
import org.springframework.web.servlet.view.json.MappingJackson2JsonView; //導入方法依賴的package包/類
@Bean
public View jsonTemplate() {
MappingJackson2JsonView view = new MappingJackson2JsonView();
view.setPrettyPrint(true);
return view;
}
示例8: resolveViewName
import org.springframework.web.servlet.view.json.MappingJackson2JsonView; //導入方法依賴的package包/類
public View resolveViewName(String viewName, Locale locale) throws Exception {
MappingJackson2JsonView view = new MappingJackson2JsonView();
view.setPrettyPrint(true);
return view;
}