Author: almaw Date: Sun May 13 06:20:55 2007 New Revision: 537583 URL: http://svn.apache.org/viewvc?view=rev&rev=537583 Log: Revert to previous behaviour and make only Bookmarkable, mounted or shared resource targets relative. This should fix AJAX stuffs.
Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java?view=diff&rev=537583&r1=537582&r2=537583 ============================================================================== --- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java (original) +++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java Sun May 13 06:20:55 2007 @@ -225,17 +225,22 @@ // First check to see whether the target is mounted CharSequence url = pathForTarget(requestTarget); + boolean makePathRelative = false; + if (url != null) { // Do nothing - we've found the URL and it's mounted. + makePathRelative = true; } else if (requestTarget instanceof IBookmarkablePageRequestTarget) { url = encode(requestCycle, (IBookmarkablePageRequestTarget)requestTarget); + makePathRelative = true; } else if (requestTarget instanceof ISharedResourceRequestTarget) { url = encode(requestCycle, (ISharedResourceRequestTarget)requestTarget); + makePathRelative = true; } else if (requestTarget instanceof IListenerInterfaceRequestTarget) { @@ -261,8 +266,11 @@ // Add the actual URL. This will be relative to the Wicket Servlet/Filter, with no leading '/'. PrependingStringBuffer prepender = new PrependingStringBuffer(url.toString()); - // Prepend prefix to the URL to make it relative to the current request. - prepender.prepend(requestCycle.getRequest().getRelativePathPrefixToWicketHandler()); + if (makePathRelative) + { + // Prepend prefix to the URL to make it relative to the current request. + prepender.prepend(requestCycle.getRequest().getRelativePathPrefixToWicketHandler()); + } String result = prepender.toString(); // We need to special-case links to the home page if we're at the same level.