Package com.endurancetrio.app.common.web
Class SitemapController
java.lang.Object
com.endurancetrio.app.common.web.SitemapController
The
SitemapController serves the /sitemap.xml endpoint with every public URL in both language
variants, annotated with hreflang alternates.
The XML is rendered from the templates/sitemap.xml template by a dedicated SpringTemplateEngine
configured with an .xml suffix and XML template mode. The engine is created in the constructor rather
than as a Spring bean so that the autoconfigured Thymeleaf engine (which uses the .html suffix
for HTML views) is left untouched.
-
Constructor Summary
ConstructorsConstructorDescriptionSitemapController(AppProperties appProperties, SitemapService sitemapService) -
Method Summary
Modifier and TypeMethodDescriptionReturns the XML sitemap with all public URLs in both language variants.
-
Constructor Details
-
SitemapController
-
-
Method Details
-
generateSitemap
@GetMapping(value="/sitemap.xml", produces="application/xml") @ResponseBody public String generateSitemap()Returns the XML sitemap with all public URLs in both language variants.- Returns:
- the rendered XML sitemap
-