Commit 424c8e37 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '320-sitemapxmlcontroller-returns-string'

* 320-sitemapxmlcontroller-returns-string:
  SitemapXMLController returns string
parents 0e1aa38f 4ec477f3
...@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
...@@ -84,7 +85,7 @@ public class SitemapXMLController { ...@@ -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/overview", 1.0), new SitemapPage("/wiews/active", 1.0), new SitemapPage("/content/terms", 1.0),
new SitemapPage("/explore", 1.0), new SitemapPage("/org/") }; 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 public @ResponseBody
String sitemapsXml(HttpServletResponse response) { String sitemapsXml(HttpServletResponse response) {
response.setContentType("text/xml"); response.setContentType("text/xml");
...@@ -102,13 +103,13 @@ public class SitemapXMLController { ...@@ -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 public @ResponseBody
String sitemapContentXml(HttpServletResponse response) { String sitemapContentXml(HttpServletResponse response) {
return writeSitemap(response, sitemapPages); 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 public @ResponseBody
String sitemapGeoXml(HttpServletResponse response) { String sitemapGeoXml(HttpServletResponse response) {
response.setContentType("text/xml"); response.setContentType("text/xml");
...@@ -126,7 +127,7 @@ public class SitemapXMLController { ...@@ -126,7 +127,7 @@ public class SitemapXMLController {
return sb.toString(); 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 public @ResponseBody
String sitemapWiewsXml(HttpServletResponse response) { String sitemapWiewsXml(HttpServletResponse response) {
response.setContentType("text/xml"); response.setContentType("text/xml");
...@@ -143,7 +144,7 @@ public class SitemapXMLController { ...@@ -143,7 +144,7 @@ public class SitemapXMLController {
return sb.toString(); 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 public @ResponseBody
String sitemapCropXml(HttpServletResponse response) { String sitemapCropXml(HttpServletResponse response) {
response.setContentType("text/xml"); response.setContentType("text/xml");
......
Supports Markdown
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