Introduce mime/media types for application/rss+xml

Issue: SPR-15109
This commit is contained in:
Mark Hobson
2017-01-07 16:53:41 +00:00
parent e4a599f961
commit 2ce2f7d9a5
6 changed files with 28 additions and 4 deletions

View File

@@ -433,7 +433,7 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
Properties props = new Properties();
if (romePresent) {
props.put("atom", MediaType.APPLICATION_ATOM_XML_VALUE);
props.put("rss", "application/rss+xml");
props.put("rss", MediaType.APPLICATION_RSS_XML_VALUE);
}
if (jaxb2Present || jackson2XmlPresent) {
props.put("xml", MediaType.APPLICATION_XML_VALUE);

View File

@@ -385,7 +385,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
Map<String, MediaType> map = new HashMap<>(4);
if (romePresent) {
map.put("atom", MediaType.APPLICATION_ATOM_XML);
map.put("rss", MediaType.valueOf("application/rss+xml"));
map.put("rss", MediaType.APPLICATION_RSS_XML);
}
if (jaxb2Present || jackson2XmlPresent) {
map.put("xml", MediaType.APPLICATION_XML);

View File

@@ -24,6 +24,8 @@ import javax.servlet.http.HttpServletResponse;
import com.rometools.rome.feed.rss.Channel;
import com.rometools.rome.feed.rss.Item;
import org.springframework.util.MimeTypeUtils;
/**
* Abstract superclass for RSS Feed views, using the
* <a href="https://github.com/rometools/rome">ROME</a> package.
@@ -46,7 +48,7 @@ import com.rometools.rome.feed.rss.Item;
public abstract class AbstractRssFeedView extends AbstractFeedView<Channel> {
public AbstractRssFeedView() {
setContentType("application/rss+xml");
setContentType(MimeTypeUtils.APPLICATION_RSS_XML_VALUE);
}
/**