Example usage for com.fasterxml.jackson.xml XmlMapper configure

List of usage examples for com.fasterxml.jackson.xml XmlMapper configure

Introduction

In this page you can find the example usage for com.fasterxml.jackson.xml XmlMapper configure.

Prototype

public ObjectMapper configure(FromXmlParser.Feature f, boolean state) 

Source Link

Usage

From source file:com.asual.summer.xml.XmlView.java

protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    response.setContentType(getContentType());
    response.setCharacterEncoding(request.getCharacterEncoding());

    XmlMapper mapper = new XmlMapper();
    mapper.configure(Feature.AUTO_CLOSE_TARGET, false);
    mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
    mapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);
    mapper.writeValue(response.getOutputStream(), filterModel(model));
}