Author: mgrigorov Date: Thu Aug 5 18:09:22 2010 New Revision: 982718 URL: http://svn.apache.org/viewvc?rev=982718&view=rev Log: merge from 1.4.x:
Author: jcompagner Date: Thu Aug 5 15:25:45 2010 New Revision: 982661 URL: http://svn.apache.org/viewvc?rev=982661&view=rev Log: added support for hostname so that the server can know the real host the client is talking to Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html?rev=982718&r1=982717&r2=982718&view=diff ============================================================================== --- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html Thu Aug 5 18:09:22 2010 @@ -42,6 +42,7 @@ document.postback.utcDSTOffset.value = (new Date(new Date().getFullYear(), 6, 1, 0, 0, 0, 0).getTimezoneOffset() / -60); document.postback.browserWidth.value = window.innerWidth || document.body.offsetWidth; document.postback.browserHeight.value = window.innerHeight || document.body.offsetHeight; + document.postback.hostname.value = window.location.hostname; document.postback.submit(); } @@ -64,6 +65,7 @@ <input type="text" wicket:id="utcDSTOffset" /> <input type="text" wicket:id="browserWidth" /> <input type="text" wicket:id="browserHeight" /> + <input type="text" wicket:id="hostname" /> </form> </wicket:panel> </html> Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java?rev=982718&r1=982717&r2=982718&view=diff ============================================================================== --- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java Thu Aug 5 18:09:22 2010 @@ -101,6 +101,7 @@ public class BrowserInfoForm extends Pan form.add(new TextField<String>("utcDSTOffset")); form.add(new TextField<String>("browserWidth")); form.add(new TextField<String>("browserHeight")); + form.add(new TextField<String>("hostname")); add(form); } @@ -146,6 +147,7 @@ public class BrowserInfoForm extends Pan private String utcDSTOffset; private String browserWidth; private String browserHeight; + private String hostname; /** * Gets browserHeight. @@ -312,6 +314,7 @@ public class BrowserInfoForm extends Pan properties.setScreenColorDepth(getInt(screenColorDepth)); properties.setUtcOffset(utcOffset); properties.setUtcDSTOffset(utcDSTOffset); + properties.setHostname(hostname); } /** @@ -458,6 +461,23 @@ public class BrowserInfoForm extends Pan } /** + * @param hostname + * the hostname shown in the browser. + */ + public void setHostname(String hostname) + { + this.hostname = hostname; + } + + /** + * @return The clients hostname shown in the browser + */ + public String getHostname() + { + return hostname; + } + + /** * Sets utcOffset. * * @param utcOffset Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java?rev=982718&r1=982717&r2=982718&view=diff ============================================================================== --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java Thu Aug 5 18:09:22 2010 @@ -97,6 +97,8 @@ public class ClientProperties implements private String utcOffset; + private String hostname; + /** * @return The browser height at the time it was measured */ @@ -186,6 +188,14 @@ public class ClientProperties implements } /** + * @return The clients hostname shown in the browser + */ + public String getHostname() + { + return hostname; + } + + /** * @return Color depth of the screen in bits (integer). */ public int getScreenColorDepth() @@ -1020,6 +1030,15 @@ public class ClientProperties implements } /** + * @param hostname + * the hostname shown in the browser. + */ + public void setHostname(String hostname) + { + this.hostname = hostname; + } + + /** * @param screenColorDepth * Color depth of the screen in bits (integer). */
