Commit 8d45d0c1 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov Committed by Matija Obreza

SitemapXMLController returns string

parent 06db1910
Pipeline #6326 passed with stages
in 3 minutes 59 seconds
......@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -84,7 +85,7 @@ public class SitemapXMLController {
new SitemapPage("/explore/overview", 1.0), new SitemapPage("/wiews/active", 1.0), new SitemapPage("/content/terms", 1.0),
new SitemapPage("/explore", 1.0), new SitemapPage("/org/") };
@RequestMapping(value = "/sitemap.xml", method = RequestMethod.GET)
@RequestMapping(value = "/sitemap.xml", method = RequestMethod.GET, produces = { MediaType.TEXT_XML_VALUE })
public @ResponseBody
String sitemapsXml(HttpServletResponse response) {
response.setContentType("text/xml");
......@@ -102,13 +103,13 @@ public class SitemapXMLController {
}
@RequestMapping(value = "/sitemap-content.xml", method = RequestMethod.GET)
@RequestMapping(value = "/sitemap-content.xml", method = RequestMethod.GET, produces = { MediaType.TEXT_XML_VALUE })
public @ResponseBody
String sitemapContentXml(HttpServletResponse response) {
return writeSitemap(response, sitemapPages);
}
@RequestMapping(value = "/sitemap-geo.xml", method = RequestMethod.GET)
@RequestMapping(value = "/sitemap-geo.xml", method = RequestMethod.GET, produces = { MediaType.TEXT_XML_VALUE })
public @ResponseBody
String sitemapGeoXml(HttpServletResponse response) {
response.setContentType("text/xml");
......@@ -126,7 +127,7 @@ public class SitemapXMLController {
return sb.toString();
}
@RequestMapping(value = "/sitemap-wiews.xml", method = RequestMethod.GET)
@RequestMapping(value = "/sitemap-wiews.xml", method = RequestMethod.GET, produces = { MediaType.TEXT_XML_VALUE })
public @ResponseBody
String sitemapWiewsXml(HttpServletResponse response) {
response.setContentType("text/xml");
......@@ -143,7 +144,7 @@ public class SitemapXMLController {
return sb.toString();
}
@RequestMapping(value = "/sitemap-crop.xml", method = RequestMethod.GET)
@RequestMapping(value = "/sitemap-crop.xml", method = RequestMethod.GET, produces = { MediaType.TEXT_XML_VALUE })
public @ResponseBody
String sitemapCropXml(HttpServletResponse response) {
response.setContentType("text/xml");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment