Hi,

I would like to vote -1 for this commit because this change seems to be the
wrong solution and it breaks Stanbol instances which run on another alias
for static resources.

The addressed problem is that the method getStaticRootURL returns by default
a wrong value when Stanbol is deployed in a WAR context. But changing the
return value by adding the base URI string at the beginning is not correct.
The alias and static root resource alias (STATIC_RESOURCES_ROOT_URL) of
Stanbol should be configured correctly when running in a WAR context. Then
this problem would not occur.

I'm not sure about the procedure now. I think as soon as a committer votes
-1 for a commit the commit has to be reverted in first place. Should I do
that?

Best,
 - Fabian

Am Montag, 17. Oktober 2011 schrieb :

> 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")
>
>
>

-- 
Fabian
http://twitter.com/fctwitt

Reply via email to