Uploaded image for project: 'Google Sitemap (closed)'
  1. Google Sitemap (closed)
  2. MGNLGS-5

Sitemap URI doubled Slashes in URI and three times context-path

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Neutral Neutral
    • 1.2
    • 1.1
    • None
    • Magnolia 4.4.5, local Dev ENV, Java 1.6, Tomcat 6, Derby DB

      When the configured server-Base-URL has a slash in the end, it will be doubled in the Sitemap.
      When having a context-Path other than ROOT, and the appropriate Base-URL is set, the context path gets added three times instead of once.

      While debugging, I had some troubles, especially the break-point for ch.esense.magnolia.module.googlesitemap.tags.SitemapTag.drawVirtualURIMapping(Collection, JspWriter, String); it does never run into or does not match the actual line which is executed.

      Additionally, the Store overview tells me that there is an upgrade available (1.1.0) but the version cannot be resolved by maven, also there is yet no Snapshot for 1.1.1 available? I will have to stay on 1.1 for now, since it works form Maven dependency resolving.

      Having the context-path set to test-wcms, in the server config the base-URL http://localhost:8080/test-wcms gives me:

      <loc>
      http://localhost:8080/test-wcms/test-wcms/test-wcms/Home.html
      </loc>
      <lastmod>2011-11-02</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.5</priority>
      </url>
      

      Having the base URL with slash appended: http://localhost:8080/vzd-wcms/ gives me:

      <loc>
      http://localhost:8080/vzd-wcms//vzd-wcms/vzd-wcms/Home.html
      </loc>
      <lastmod>2011-11-02</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.5</priority>
      </url>
      

      Behavior is stable either when rendering Virtual URI or a website Page node.

      Probably there is a problem here when not running on ROOT-context (ch.esense.magnolia.module.googlesitemap.tags.SitemapTag.drawVirtualURIMapping, line 291):

                          out.print(defaultBaseUrl); // once adding context-path from default Base URL
                          // context path
                          out.print(((HttpServletRequest) this.pageContext
                                  .getRequest()).getContextPath()); // second time adding context-path
                          // handle
                          out.print(node.getNodeData("fromURI").getString()); // maybe from-URI is already prepended with the context-path here already - I guess no..?
      

        Acceptance criteria

              fgrilli Federico Grilli
              meglur Marco Glur
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: