Author: jcompagner
Date: Tue Mar 17 11:38:12 2009
New Revision: 755198

URL: http://svn.apache.org/viewvc?rev=755198&view=rev
Log:
fixed the setURL and geturls so that it correctly returns what it the servlet 
should return

Modified:
    
wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java

Modified: 
wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java?rev=755198&r1=755197&r2=755198&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java
 (original)
+++ 
wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java
 Tue Mar 17 11:38:12 2009
@@ -806,6 +806,14 @@
                {
                        return getContextPath() + getServletPath();
                }
+               else
+               {
+                       int index = url.indexOf("?");
+                       if (index != -1)
+                       {
+                               return url.substring(0, index);
+                       }
+               }
                return url;
        }
 
@@ -1132,6 +1140,10 @@
                        int index = url.indexOf("/", 7);
                        url = url.substring(index);
                }
+               if (!url.startsWith("/"))
+               {
+                       url = getContextPath() + getServletPath() + "/" + url;
+               }
                this.url = url;
                if (url.startsWith(getContextPath()))
                {


Reply via email to