Sitemap URI doubled Slashes in URI and three times context-path
---------------------------------------------------------------
Key: MGNLGS-5
URL: http://jira.magnolia-cms.com/browse/MGNLGS-5
Project: Magnolia Google Sitemap Module
Issue Type: Bug
Affects Versions: 1.1
Environment: Magnolia 4.4.5, local Dev ENV, Java 1.6, Tomcat 6, Derby
DB
Reporter: Marco Glur
Assignee: Federico Grilli
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:
{code}
<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>
{code}
Having the base URL with slash appended: {{http://localhost:8080/vzd-wcms/}}
gives me:
{code}
<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>
{code}
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):
{code}
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..?
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------