spring-framework / org.springframework.web.servlet.view.xml / MappingJackson2XmlView

MappingJackson2XmlView

open class MappingJackson2XmlView : AbstractJackson2View

Spring MVC View that renders XML content by serializing the model for the current request using Jackson 2's XmlMapper.

The Object to be serialized is supplied as a parameter in the model. The first serializable entry is used. Users can either specify a specific entry in the model via the sourceKey property.

The default constructor uses the default configuration provided by Jackson2ObjectMapperBuilder.

Compatible with Jackson 2.6 and higher, as of Spring 4.3.

Author
Sebastien Deleuze

Since
4.1

Constructors

<init>

MappingJackson2XmlView()

Construct a new MappingJackson2XmlView using default configuration provided by Jackson2ObjectMapperBuilder and setting the content type to application/xml.

MappingJackson2XmlView(xmlMapper: XmlMapper)

Construct a new MappingJackson2XmlView using the provided XmlMapper and setting the content type to application/xml.

Properties

DEFAULT_CONTENT_TYPE

static val DEFAULT_CONTENT_TYPE: String

Functions

setModelKey

open fun setModelKey(modelKey: String): Unit

{@inheritDoc}