You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2013/07/12 15:18:19 UTC

[1/3] git commit: WICKET-5270 Do not set the location.hash when clicking on a link

Updated Branches:
  refs/heads/master ec94dab7d -> d4bbaf2c8


WICKET-5270 Do not set the location.hash when clicking on a link


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/d4bbaf2c
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/d4bbaf2c
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/d4bbaf2c

Branch: refs/heads/master
Commit: d4bbaf2c8e6c6ed2e61d047c38744e94c8868f03
Parents: 0f66658
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Jul 12 16:15:11 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Jul 12 16:18:12 2013 +0300

----------------------------------------------------------------------
 .../apache/wicket/ajax/markup/html/AjaxLink.java |  2 +-
 .../ajax/markup/html/form/AjaxSubmitLink.java    |  2 +-
 .../wicket/markup/html/form/SubmitLink.java      |  2 +-
 .../ajaxLink/AjaxLinkPageExpectedResult.html     |  2 +-
 .../ajax/markup/html/ajaxLink/AjaxLinkTest.java  | 19 +------------------
 .../AjaxLinkWithBorderPageExpectedResult.html    |  2 +-
 .../html/ajaxLink/AjaxPage2_ExpectedResult.html  |  2 +-
 .../HideableBorderPage_ExpectedResult.html       |  2 +-
 .../panel/InlinePanelPageExpectedResult_7.html   |  2 +-
 .../panel/InlinePanelPageExpectedResult_8.html   |  2 +-
 10 files changed, 10 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java
index 8568dcf..3f75896 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java
@@ -108,7 +108,7 @@ public abstract class AjaxLink<T> extends AbstractLink implements IAjaxLink, IGe
 			if (tag.getName().equalsIgnoreCase("a") || tag.getName().equalsIgnoreCase("link") ||
 				tag.getName().equalsIgnoreCase("area"))
 			{
-				tag.put("href", "#");
+				tag.put("href", "javascript:;");
 			}
 		}
 		else

http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
index fd54cee..89e50e4 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
@@ -153,7 +153,7 @@ public abstract class AjaxSubmitLink extends AbstractSubmitLink
 		{
 			if (tag.getName().toLowerCase().equals("a"))
 			{
-				tag.put("href", "#");
+				tag.put("href", "javascript:;");
 			}
 		}
 		else

http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SubmitLink.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SubmitLink.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SubmitLink.java
index 2d4d261..d01ec8b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SubmitLink.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SubmitLink.java
@@ -160,7 +160,7 @@ public class SubmitLink extends AbstractSubmitLink
 		{
 			if (tag.getName().equalsIgnoreCase("a"))
 			{
-				tag.put("href", "#");
+				tag.put("href", "javascript:;");
 			}
 			tag.put("onclick", getTriggerJavaScript());
 		}

http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkPageExpectedResult.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkPageExpectedResult.html b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkPageExpectedResult.html
index 03b2f6f..59a63d4 100644
--- a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkPageExpectedResult.html
+++ b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkPageExpectedResult.html
@@ -22,6 +22,6 @@ Wicket.Ajax.ajax({"u":"../page?0-1.IBehaviorListener.0-ajaxLink","e":"click","c"
 </script>
 </head><body>
   <span wicket:id="ajaxLabel" id="ajaxLabel2">UpdateMe</span>
-  <a href="#" wicket:id="ajaxLink" id="ajaxLink1">Update</a>
+  <a href="javascript:;" wicket:id="ajaxLink" id="ajaxLink1">Update</a>
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkTest.java b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkTest.java
index e76f875..5b99e11 100644
--- a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkTest.java
@@ -21,7 +21,6 @@ import org.apache.wicket.Page;
 import org.apache.wicket.WicketTestCase;
 import org.apache.wicket.behavior.AbstractAjaxBehavior;
 import org.apache.wicket.util.tester.TagTester;
-import org.junit.Ignore;
 import org.junit.Test;
 
 
@@ -42,7 +41,7 @@ public class AjaxLinkTest extends WicketTestCase
 		TagTester ajaxLink = tester.getTagByWicketId("ajaxLink");
 
 		// It was a link to google in the markup, but should be replaced to "#"
-		assertTrue(ajaxLink.getAttributeIs("href", "#"));
+		assertTrue(ajaxLink.getAttributeIs("href", "javascript:;"));
 	}
 
 	/**
@@ -61,22 +60,6 @@ public class AjaxLinkTest extends WicketTestCase
 	}
 
 	/**
-	 * Test that the onclick on ajax link has "return !wcall;" at the end. This ensures that
-	 * execution is not turned over to the href attribute, which would then append # to the url.
-	 */
-	@Test
-	@Ignore
-	// TODO Wicket.next - re-enable
-	public void javaScriptEndsWithReturn()
-	{
-		tester.startPage(AjaxLinkPage.class);
-
-		TagTester ajaxLink = tester.getTagByWicketId("ajaxLink");
-
-		assertTrue(ajaxLink.getAttributeEndsWith("onclick", "return !wcall;"));
-	}
-
-	/**
 	 * 
 	 * @throws Exception
 	 */

http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkWithBorderPageExpectedResult.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkWithBorderPageExpectedResult.html b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkWithBorderPageExpectedResult.html
index 0928af9..10fc466 100644
--- a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkWithBorderPageExpectedResult.html
+++ b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkWithBorderPageExpectedResult.html
@@ -25,7 +25,7 @@ Wicket.Ajax.ajax({"u":"../page?0-1.IBehaviorListener.0-border-border_body-ajaxLi
     Border
     <wicket:body>
     <span wicket:id="ajaxLabel" id="ajaxLabel2">UpdateMe</span>
-    <a href="#" wicket:id="ajaxLink" id="ajaxLink1">Update</a>
+    <a href="javascript:;" wicket:id="ajaxLink" id="ajaxLink1">Update</a>
   </wicket:body>
     Border
   </wicket:border></span>

http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxPage2_ExpectedResult.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxPage2_ExpectedResult.html b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxPage2_ExpectedResult.html
index f64f8f3..305359c 100644
--- a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxPage2_ExpectedResult.html
+++ b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxPage2_ExpectedResult.html
@@ -25,7 +25,7 @@ Wicket.Ajax.ajax({"u":"../page?0-1.IBehaviorListener.0-pageLayout-pageLayout_bod
 			<span>Marker for border start</span>
 			<wicket:body>
 	  <span wicket:id="ajaxLabel" id="ajaxLabel2">AAAAAAA</span>
-	  <a href="#" wicket:id="ajaxLink" id="ajaxLink1">Update</a>
+	  <a href="javascript:;" wicket:id="ajaxLink" id="ajaxLink1">Update</a>
   </wicket:body>
 			<span>Marker for border end</span>
 		</wicket:border></span>

http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/test/java/org/apache/wicket/markup/html/border/HideableBorderPage_ExpectedResult.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/border/HideableBorderPage_ExpectedResult.html b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/HideableBorderPage_ExpectedResult.html
index 078c511..237ccf1 100644
--- a/wicket-core/src/test/java/org/apache/wicket/markup/html/border/HideableBorderPage_ExpectedResult.html
+++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/HideableBorderPage_ExpectedResult.html
@@ -22,7 +22,7 @@ Wicket.Ajax.ajax({"u":"../page?0-1.IBehaviorListener.0-hideable-hideLink","e":"c
 </script>
 </head><body>
   <div wicket:id="hideable"><wicket:border>
-  <a wicket:id="hideLink" id="hideLink1" href="#">Hide contents</a>
+  <a wicket:id="hideLink" id="hideLink1" href="javascript:;">Hide contents</a>
   <div wicket:id="wrapper" id="wrapper2">
   <wicket:body>
     Contents <span wicket:id="content">label</span>

http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_7.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_7.html b/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_7.html
index ded2eaf..aaec104 100644
--- a/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_7.html
+++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_7.html
@@ -34,7 +34,7 @@ Wicket.Ajax.ajax({"u":"../page?0-1.IBehaviorListener.0-provider-ajaxRefresh","e"
 
 
 
-<a wicket:id="ajaxRefresh" id="ajaxRefresh1" href="#">AJAX refresh</a>
+<a wicket:id="ajaxRefresh" id="ajaxRefresh1" href="javascript:;">AJAX refresh</a>
 
 </wicket:panel></div>
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/d4bbaf2c/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_8.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_8.html b/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_8.html
index ab18804..a2dc136 100644
--- a/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_8.html
+++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/panel/InlinePanelPageExpectedResult_8.html
@@ -26,7 +26,7 @@ Wicket.Ajax.ajax({"u":"../page?0-1.IBehaviorListener.0-add","e":"click","c":"add
   <span wicket:id="number">0</span><br/>
   <div id="nextContainer2" style="display:none"></div>
 </div>
-<a wicket:id="add" id="add1" href="#">Add</a>
+<a wicket:id="add" id="add1" href="javascript:;">Add</a>
 
 
 


[2/3] git commit: Make it possible to run Wicket examples in HTTPS mode for easier testing

Posted by mg...@apache.org.
Make it possible to run Wicket examples in HTTPS mode for easier testing


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/0f666585
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/0f666585
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/0f666585

Branch: refs/heads/master
Commit: 0f666585b2112f2b609b90052a2eaf6352c56009
Parents: abe3beb
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Jul 12 16:00:07 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Jul 12 16:18:12 2013 +0300

----------------------------------------------------------------------
 .../apache/wicket/examples/StartExamples.java   |  32 +++++++++++++++++++
 wicket-examples/src/test/resources/keystore     | Bin 0 -> 1481 bytes
 2 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/0f666585/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java b/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java
index 57612a6..b507a77 100644
--- a/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java
+++ b/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java
@@ -20,10 +20,14 @@ import java.lang.management.ManagementFactory;
 
 import javax.management.MBeanServer;
 
+import org.apache.wicket.util.time.Duration;
 import org.eclipse.jetty.jmx.MBeanContainer;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.server.ssl.SslSocketConnector;
+import org.eclipse.jetty.util.resource.Resource;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
 import org.eclipse.jetty.webapp.WebAppContext;
 
 /**
@@ -54,6 +58,34 @@ public class StartExamples
 		connector.setPort(8080);
 		server.setConnectors(new Connector[] { connector });
 
+		Resource keystore = Resource.newClassPathResource("/keystore");
+		if (keystore != null && keystore.exists()) {
+			// if a keystore for a SSL certificate is available, start a SSL
+			// connector on port 8443.
+			// By default, the quickstart comes with a Apache Wicket Quickstart
+			// Certificate that expires about half way september 2021. Do not
+			// use this certificate anywhere important as the passwords are
+			// available in the source.
+
+			connector.setConfidentialPort(8443);
+
+			SslContextFactory factory = new SslContextFactory();
+			factory.setKeyStoreResource(keystore);
+			factory.setKeyStorePassword("wicket");
+			factory.setTrustStoreResource(keystore);
+			factory.setKeyManagerPassword("wicket");
+			SslSocketConnector sslConnector = new SslSocketConnector(factory);
+			int timeout = (int) Duration.ONE_HOUR.getMilliseconds();
+			sslConnector.setMaxIdleTime(timeout);
+			sslConnector.setPort(8443);
+			sslConnector.setAcceptors(4);
+			server.addConnector(sslConnector);
+
+			System.out.println("SSL access to the examples has been enabled on port 8443");
+			System.out.println("You can access the application using SSL on https://localhost:8443");
+			System.out.println();
+		}
+
 		WebAppContext bb = new WebAppContext();
 		bb.setServer(server);
 		bb.setContextPath("/");

http://git-wip-us.apache.org/repos/asf/wicket/blob/0f666585/wicket-examples/src/test/resources/keystore
----------------------------------------------------------------------
diff --git a/wicket-examples/src/test/resources/keystore b/wicket-examples/src/test/resources/keystore
new file mode 100644
index 0000000..30bbc90
Binary files /dev/null and b/wicket-examples/src/test/resources/keystore differ


[3/3] git commit: Java 7 diamonds

Posted by mg...@apache.org.
Java 7 diamonds


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/abe3beb1
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/abe3beb1
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/abe3beb1

Branch: refs/heads/master
Commit: abe3beb18c2b2c595d4e86b970c0a9a774cd1acc
Parents: ec94dab
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Jul 12 15:45:36 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Jul 12 16:18:12 2013 +0300

----------------------------------------------------------------------
 wicket-core/src/main/java/org/apache/wicket/ConverterLocator.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/abe3beb1/wicket-core/src/main/java/org/apache/wicket/ConverterLocator.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ConverterLocator.java b/wicket-core/src/main/java/org/apache/wicket/ConverterLocator.java
index eb9c7ac..be362e8 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ConverterLocator.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ConverterLocator.java
@@ -74,7 +74,7 @@ public class ConverterLocator implements IConverterLocator
 		 */
 		private DefaultConverter(Class<C> type)
 		{
-			this.type = new WeakReference<Class<C>>(type);
+			this.type = new WeakReference<>(type);
 		}
 
 		/**