diff --git a/org.springframework.web/src/main/java/org/springframework/http/MediaType.java b/org.springframework.web/src/main/java/org/springframework/http/MediaType.java index 83715d8ff9642b21be88effa50b63799e5622ae9..185e9e6cab590b646faebddc21ae112b28ecf477 100644 --- a/org.springframework.web/src/main/java/org/springframework/http/MediaType.java +++ b/org.springframework.web/src/main/java/org/springframework/http/MediaType.java @@ -78,6 +78,11 @@ public class MediaType implements Comparable { * */ public final static MediaType APPLICATION_XHTML_XML; + /** + * Public constant media type for {@code application/xml}. + */ + public final static MediaType APPLICATION_XML; + /** * Public constant media type for {@code image/gif}. */ @@ -93,11 +98,6 @@ public class MediaType implements Comparable { */ public final static MediaType IMAGE_PNG; - /** - * Public constant media type for {@code image/xml}. - */ - public final static MediaType APPLICATION_XML; - /** * Public constant media type for {@code multipart/form-data}. * */ diff --git a/org.springframework.web/src/main/java/org/springframework/http/converter/xml/AbstractXmlHttpMessageConverter.java b/org.springframework.web/src/main/java/org/springframework/http/converter/xml/AbstractXmlHttpMessageConverter.java index bdb3c351d9d00bafe3498b964530ca0199f96d40..f10f7114eb594ddb8637e36eecd1c19055361c36 100644 --- a/org.springframework.web/src/main/java/org/springframework/http/converter/xml/AbstractXmlHttpMessageConverter.java +++ b/org.springframework.web/src/main/java/org/springframework/http/converter/xml/AbstractXmlHttpMessageConverter.java @@ -52,7 +52,7 @@ public abstract class AbstractXmlHttpMessageConverter extends AbstractHttpMes * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}. */ protected AbstractXmlHttpMessageConverter() { - super(new MediaType("application", "xml"), new MediaType("text", "xml"), new MediaType("application", "*+xml")); + super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml")); } @@ -70,7 +70,7 @@ public abstract class AbstractXmlHttpMessageConverter extends AbstractHttpMes * Transforms the given {@code Source} to the {@code Result}. * @param source the source to transform from * @param result the result to transform to - * @throws HttpMessageConversionException in case of transformation errors + * @throws TransformerException in case of transformation errors */ protected void transform(Source source, Result result) throws TransformerException { this.transformerFactory.newTransformer().transform(source, result);