Author: suat
Date: Mon Oct 17 11:17:26 2011
New Revision: 1185105
URL: http://svn.apache.org/viewvc?rev=1185105&view=rev
Log:
STANBOL-348:
-Updated getStaticRootURL so that it returns the full URL of static resources.
This change is done as static resources are deployed under the context of war
file (e.g under http://localhost:8080/stanbol/static/home/style/stanbol.css
instead of http://localhost:8090/static/home/style/stanbol.css).
Modified:
incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/resource/BaseStanbolResource.java
Modified:
incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/resource/BaseStanbolResource.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/resource/BaseStanbolResource.java?rev=1185105&r1=1185104&r2=1185105&view=diff
==============================================================================
---
incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/resource/BaseStanbolResource.java
(original)
+++
incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/resource/BaseStanbolResource.java
Mon Oct 17 11:17:26 2011
@@ -111,7 +111,8 @@ public class BaseStanbolResource {
}
public String getStaticRootUrl() {
- return (String) servletContext.getAttribute(STATIC_RESOURCES_ROOT_URL);
+ String baseURIStr = uriInfo.getBaseUri().toString();
+ return baseURIStr.substring(0, baseURIStr.length()-1) + (String)
servletContext.getAttribute(STATIC_RESOURCES_ROOT_URL);
}
@SuppressWarnings("unchecked")