You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2009/10/24 11:59:05 UTC

svn commit: r829335 - /wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java

Author: jdonnerstag
Date: Sat Oct 24 09:59:05 2009
New Revision: 829335

URL: http://svn.apache.org/viewvc?rev=829335&view=rev
Log:
fixed  Text on BrowserInfoPage should be customizable
Issue: WICKET-2326

Modified:
    wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java

Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java?rev=829335&r1=829334&r2=829335&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java Sat Oct 24 09:59:05 2009
@@ -24,6 +24,7 @@
 import org.apache.wicket.Response;
 import org.apache.wicket.RestartResponseException;
 import org.apache.wicket.Session;
+import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.pages.BrowserInfoPage;
 import org.apache.wicket.protocol.http.request.WebClientInfo;
 import org.apache.wicket.protocol.http.servlet.ServletWebRequest;
@@ -273,7 +274,7 @@
 				// doing that now and redirect
 				session.setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE);
 				String url = "/" + getRequest().getURL();
-				throw new RestartResponseException(new BrowserInfoPage(url));
+				throw new RestartResponseException(newBrowserInfoPage(url));
 			}
 			// if we get here, the redirect already has been done; clear
 			// the meta data entry; we don't need it any longer is the client
@@ -284,6 +285,20 @@
 	}
 
 	/**
+	 * Override this method if you want to use a custom page for gathering the client's browser
+	 * information.<br/>
+	 * The easiest way is just to extend {@link BrowserInfoPage} and provide your own markup file
+	 * 
+	 * @param url
+	 *            the url to redirect to when the browser info is handled
+	 * @return the {@link WebPage} which should be used while gathering browser info
+	 */
+	protected WebPage newBrowserInfoPage(String url)
+	{
+		return new BrowserInfoPage(url);
+	}
+
+	/**
 	 * If it's an ajax request we always redirect.
 	 * 
 	 * @see org.apache.wicket.RequestCycle#isRedirect()
@@ -301,9 +316,11 @@
 		}
 	}
 
+	/**
+	 * 
+	 */
 	void unset()
 	{
 		set(null);
 	}
-
 }