Title | ShortURLConstructor does not work with relative InterWikiLinks |
Date | 10-Feb-2006 10:41:44 EET |
Version | 2.2.33, v2.3.72-cvs |
Submitter | Christoph Sauer |
Bug criticality | MediumBug |
Browser version | Firefox 1.5 |
Bug status | ClosedBug |
PageProvider used | VersioningFileProvider |
Servlet Container | Tomcat 5.0.22 |
Operating System | Windows |
URL | Edit:LeftMenu |
Java version | 1.5.0_02-b09 |
Affects both ShortURLConstructor and ShortViewURLConstructor:
The InterWiki Link Edit:SomePage is defined as Edit.jsp?page=%s. If ShortURLConstructor is defined, it is rendered as
http://www.jspwiki.org/wiki/Edit.jsp?page=SomePageinstead of
http://www.jspwiki.org/Edit.jsp?page=SomePage
This also causes Contributed Plugins to fail which use relative links to servlets. For example the ImageXPlugin generates this relative link to a servlet:
<img src="imageServlet?page=test.png&width=250" width="250" />
With the ShortURLConstructor it points to this URL
http://www.jspwiki.org/wiki/imageServlet?page=test.png&width=250instead of the correct mapping which is
http://www.jspwiki.org/imageServlet?page=test.png&width=250
Today I made some experiments with ShortURLConstructor and have seen similar behavior as well. Also I expierienced problems even with the Main page. In my case I had a contextPath other than "wiki". Switched back to default and will observe this Bug.
--Christian Buchegger, 06-May-2006
Plugins should use URL generation, using the WikiContext.getURL() mechanism, which will figure out the correct URL. The bug is thus in the plugins.