externalGraphic with relative path and query parameters problem
Description
Environment
Attachments
Activity

Andrea Aime February 15, 2017 at 11:48 AM
Mass closing all resolved issues not modified in the last 4 weeks

codehaus April 10, 2015 at 4:51 PM
CodeHaus Comment From: aaime - Time: Thu, 25 Dec 2014 04:45:10 -0600
---------------------
<p>Hi Tobias, either would work, or you can add a test in GeoserverDataDirectoryTest</p>

codehaus April 10, 2015 at 4:51 PM
CodeHaus Comment From: codax - Time: Wed, 19 Nov 2014 07:59:49 -0600
---------------------
<p>I know but I did not find a proper place to put the test in. Should it be in ResourcePoolTest or should I implement a new class that extends GeoServerSystemTestSupport?</p>

codehaus April 10, 2015 at 4:51 PM
CodeHaus Comment From: aaime - Time: Wed, 19 Nov 2014 06:53:17 -0600
---------------------
<p>The change seems reasonable, but needs a test.
See the contributing guidelines for how to contribute changes to GeoServer: <a href="https://github.com/geoserver/geoserver/blob/master/CONTRIBUTING.md" class="external-link" rel="nofollow">https://github.com/geoserver/geoserver/blob/master/CONTRIBUTING.md</a></p>

codehaus April 10, 2015 at 4:51 PM
CodeHaus Comment From: codax - Time: Wed, 19 Nov 2014 05:54:41 -0600
---------------------
<p>And here is the patch. Indeed the "problem" was not within the DefaultResourceLocator but in GeoServerDataDirectory which overwrites locateResources and strips all query parameters.</p>
<p>I appended if existing the queryparameter again and delivered this corrected URL.</p>
I don't know, if this should be here or in GeoTools Issues.
I implemented a ExternalGraphicFactory which is working. (getIcon gets called). So I wanted to provide some additional parameters using the URL of my online resource.
Here are the tests I did.
myimage.png -> worked
myimage.png?param=testparam --> stripped parameter I got URL myimage.png
<absolute-path>/myimage.png?param=testparam --> worked
and this is my hack at the moment for relative paths:
myimage.png&param=testparam --> work (path and parameter separated by a &
Here is the snipped of my external graphics:
<ExternalGraphic>
<OnlineResource xlink:href="myimage.png" />
<Format>myformat</Format>
</ExternalGraphic>
The logging does say:
18 Nov 09:43:46 DEBUG
Here the parameter is still there but in my factory class the param - part is not there.
However, this is not a problem with GeoServer 2.3, 2.5.