Author: ivaynberg
Date: Sun Feb 1 07:24:44 2009
New Revision: 739703
URL: http://svn.apache.org/viewvc?rev=739703&view=rev
Log:
WICKET-1567
Modified:
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java
Modified:
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java?rev=739703&r1=739702&r2=739703&view=diff
==============================================================================
---
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java
(original)
+++
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java
Sun Feb 1 07:24:44 2009
@@ -86,7 +86,7 @@
final MarkupContainer container, final String autoId,
final PathInfo pathInfo,
final String attribute)
{
- if (!pathInfo.absolute)
+ if (!pathInfo.absolute && (pathInfo.path != null) &&
(pathInfo.path.length() > 0))
{
// Href is relative. Create a resource
reference pointing at
// this file
@@ -98,10 +98,8 @@
// contributed it.
Class clazz =
container.getMarkupStream().getContainerClass();
- // However if the markup stream is a merged
markup stream
- // (inheritance),
- // than we need the class of the markup file
which contained the
- // tag.
+ // However if the markup stream is a merged
markup stream (inheritance), than we
+ // need the class of the markup file which
contained the tag.
if
(container.getMarkupStream().getTag().getMarkupClass() != null)
{
clazz =
container.getMarkupStream().getTag().getMarkupClass();
@@ -282,6 +280,17 @@
}
}
+ // Anchors without path, e.g. "#link"
+ if (anchor == null)
+ {
+ pos = infoPath.indexOf("#");
+ if (pos != -1)
+ {
+ anchor = infoPath.substring(pos);
+ infoPath = infoPath.substring(0, pos);
+ }
+ }
+
path = infoPath;
this.extension = extension;
this.anchor = anchor;