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

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

Introduction

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

Prototype

public XmlMapper() 

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));
}