You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2012/02/27 18:08:12 UTC
git commit: Backport improvement from 1.5.x
Updated Branches:
refs/heads/wicket-1.4.x 92fe5ca04 -> 189359078
Backport improvement from 1.5.x
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/18935907
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/18935907
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/18935907
Branch: refs/heads/wicket-1.4.x
Commit: 1893590789cb3edfea3ad4674a82dc1162cd315b
Parents: 92fe5ca
Author: martin-g <mg...@apache.org>
Authored: Mon Feb 27 19:07:28 2012 +0200
Committer: martin-g <mg...@apache.org>
Committed: Mon Feb 27 19:07:28 2012 +0200
----------------------------------------------------------------------
.../apache/wicket/markup/html/PackageResource.java | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/18935907/wicket/src/main/java/org/apache/wicket/markup/html/PackageResource.java
----------------------------------------------------------------------
diff --git a/wicket/src/main/java/org/apache/wicket/markup/html/PackageResource.java b/wicket/src/main/java/org/apache/wicket/markup/html/PackageResource.java
index 5ed9636..0bb5ddf 100644
--- a/wicket/src/main/java/org/apache/wicket/markup/html/PackageResource.java
+++ b/wicket/src/main/java/org/apache/wicket/markup/html/PackageResource.java
@@ -676,6 +676,21 @@ public class PackageResource extends WebResource implements IModifiable, IPackag
if (resourceStream instanceof IFixedLocationResourceStream)
{
realPath = ((IFixedLocationResourceStream)resourceStream).locationAsString();
+ if (realPath != null)
+ {
+ int index = realPath.indexOf(path);
+ if (index != -1)
+ {
+ realPath = realPath.substring(index);
+ }
+ else
+ // TODO just fall back on the full path without a scope..
+ return guard.accept(null, realPath);
+ }
+ else
+ {
+ realPath = path;
+ }
}
return guard.accept(scope, realPath);
}