code: private void showRobotsTxt() throws Exception {
  
          CmsObject cms = getCmsObject();
          StringBuffer buffer = new StringBuffer();
          I_CmsResourceType seoFileType = OpenCms.getResourceManager().getResourceType(
              CmsXmlSeoConfiguration.SEO_FILE_TYPE);
          List<CmsResource> seoFiles = cms.readResources(
              "/",
              CmsResourceFilter.DEFAULT_FILES.addRequireVisible().addRequireType(seoFileType));
          for (CmsResource seoFile : seoFiles) {
              try {
                  if (seoFile.getName().contains("test")) {
                      continue;
                  }
                  CmsXmlSeoConfiguration seoFileConfig = new CmsXmlSeoConfiguration();
                  seoFileConfig.load(cms, seoFile);
                  if (seoFileConfig.isXmlSitemapMode()) {
                      buffer.append(
                          "Sitemap: "
                              + CmsXmlSitemapGenerator.replaceServerUri(
                                  OpenCms.getLinkManager().getOnlineLink(cms, cms.getSitePath(seoFile)),
                                  m_configuration.getServerUrl()));
                      buffer.append("\n");
                  }
              } catch (CmsException e) {
                  LOG.error("Error while generating robots.txt : " + e.getLocalizedMessage(), e);
              }
          }
          buffer.append("\n");
          buffer.append(m_configuration.getRobotsTxtText());
          buffer.append("\n");
          getResponse().getWriter().print(buffer.toString());
      }
docs: Renders the robots.txt data containing the sitemaps automatically.<p>
  
  @throws Exception if something goes wrong