#56 - LinkBuilderSupport.slash(…) now handles fragments correctly.

This commit is contained in:
Oliver Gierke
2013-03-08 17:49:45 +01:00
parent db4f96a4e0
commit 2c49f397da
2 changed files with 23 additions and 0 deletions

View File

@@ -62,6 +62,10 @@ public abstract class LinkBuilderSupport<T extends LinkBuilder> implements LinkB
String path = object.toString();
if (path.endsWith("#")) {
path = path.substring(0, path.length() - 1);
}
if (!StringUtils.hasText(path)) {
return getThis();
}
@@ -73,6 +77,11 @@ public abstract class LinkBuilderSupport<T extends LinkBuilder> implements LinkB
builder.pathSegment(pathSegment);
}
String fragment = components.getFragment();
if (StringUtils.hasText(fragment)) {
builder.fragment(fragment);
}
return createNewInstance(builder.query(components.getQuery()));
}