Author: jdonnerstag
Date: Sat Oct 24 09:59:40 2009
New Revision: 829336

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

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

Modified: 
wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java?rev=829336&r1=829335&r2=829336&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java
 (original)
+++ 
wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WebRequestCycle.java
 Sat Oct 24 09:59:40 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()


Reply via email to