Author: almaw Date: Thu Jan 18 06:27:11 2007 New Revision: 497443 URL: http://svn.apache.org/viewvc?view=rev&rev=497443 Log: WICKET-149 fix for mounted URLs fail if filterPath is blank
Modified: incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/servlet/ServletWebRequest.java Modified: incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/servlet/ServletWebRequest.java URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/servlet/ServletWebRequest.java?view=diff&rev=497443&r1=497442&r2=497443 ============================================================================== --- incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/servlet/ServletWebRequest.java (original) +++ incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/servlet/ServletWebRequest.java Thu Jan 18 06:27:11 2007 @@ -30,7 +30,6 @@ import wicket.IRedirectListener; import wicket.RequestListenerInterface; import wicket.WicketRuntimeException; -import wicket.markup.html.link.ILinkListener; import wicket.protocol.http.WebApplication; import wicket.protocol.http.WebRequest; import wicket.util.lang.Bytes; @@ -147,7 +146,8 @@ String rootPath = ((WebApplication)Application.get()).getRootPath(); if (url.startsWith(rootPath)) { - return rootPath.equals("/") ? url : url.substring(rootPath.length()); + // We return everything after rootPath, making sure we start with a slash. + return url.substring(rootPath.endsWith("/") ? rootPath.length() - 1 : rootPath.length()); } return null; }