[Geoserver-users] accessing www folder from header.ftl

I have some javascript files placed in the …/data/www folder that I’m trying to be able to reference as a relative path in the header.ftl file (that styles the getFeatureInfo response).

I can access the javascript files fine using the full url, eg:

but I can’t for the life of me figure out how to get it to accept a relative path… I’ve tried pretty much every combination of …/www/sorttable.js, /geoserver/www/sorttable.js, etc, etc trying to find a combination that works, but no luck so far.

Does anyone have any insight into this?

Also, is there anyway to get the baseUrl as a variable to use in the freemarker templates?

Thanks!

-Jen

Hi Jen,

Unfortunately no information about the request is passed into the template. But you should be able to use an absolute path like “/geoserver/www/sorttable.js” as the script src attribute. This makes an assumption that the server context is named “geoserver” so wouldn’t work if you deployed it under a different name.

-Justin

···

On Wed, Jun 26, 2013 at 11:50 AM, Jen Weiss <j.e.weiss@anonymised.com> wrote:

I have some javascript files placed in the …/data/www folder that I’m trying to be able to reference as a relative path in the header.ftl file (that styles the getFeatureInfo response).

I can access the javascript files fine using the full url, eg:

but I can’t for the life of me figure out how to get it to accept a relative path… I’ve tried pretty much every combination of …/www/sorttable.js, /geoserver/www/sorttable.js, etc, etc trying to find a combination that works, but no luck so far.

Does anyone have any insight into this?

Also, is there anyway to get the baseUrl as a variable to use in the freemarker templates?

Thanks!

-Jen


This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

I still can’t get this to work for me.
This works fine:

But this does not:

Could it be because it’s port 8080 instead of 80?

···

On Wed, Jun 26, 2013 at 9:31 PM, Justin Deoliveira <jdeolive@anonymised.com…> wrote:

Hi Jen,

Unfortunately no information about the request is passed into the template. But you should be able to use an absolute path like “/geoserver/www/sorttable.js” as the script src attribute. This makes an assumption that the server context is named “geoserver” so wouldn’t work if you deployed it under a different name.

-Justin

On Wed, Jun 26, 2013 at 11:50 AM, Jen Weiss <j.e.weiss@anonymised.com> wrote:

I have some javascript files placed in the …/data/www folder that I’m trying to be able to reference as a relative path in the header.ftl file (that styles the getFeatureInfo response).

I can access the javascript files fine using the full url, eg:

but I can’t for the life of me figure out how to get it to accept a relative path… I’ve tried pretty much every combination of …/www/sorttable.js, /geoserver/www/sorttable.js, etc, etc trying to find a combination that works, but no luck so far.

Does anyone have any insight into this?

Also, is there anyway to get the baseUrl as a variable to use in the freemarker templates?

Thanks!

-Jen


This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

But this does not:

Try this:

Oiva