You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jc...@apache.org on 2010/08/05 17:25:46 UTC

svn commit: r982661 - in /wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket: markup/html/pages/BrowserInfoForm.html markup/html/pages/BrowserInfoForm.java protocol/http/ClientProperties.java

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/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html
    wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java
    wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java

Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html?rev=982661&r1=982660&r2=982661&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.html Thu Aug  5 15:25:45 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/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java?rev=982661&r1=982660&r2=982661&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoForm.java Thu Aug  5 15:25:45 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/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java?rev=982661&r1=982660&r2=982661&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java Thu Aug  5 15:25:45 2010
@@ -95,6 +95,8 @@ public class ClientProperties implements
 
 	private String utcOffset;
 
+	private String hostname;
+
 	/**
 	 * @return The browser height at the time it was measured
 	 */
@@ -184,6 +186,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()
@@ -1018,6 +1028,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).
 	 */