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 2014/02/18 11:01:45 UTC
[01/17] git commit: Upgrade Jetty 9.x and Jacoco
Repository: wicket
Updated Branches:
refs/heads/sandbox/component-queueing-2 3a3e32a59 -> b3c946af7
Upgrade Jetty 9.x and Jacoco
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/efb0d458
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/efb0d458
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/efb0d458
Branch: refs/heads/sandbox/component-queueing-2
Commit: efb0d458e85553d07b7f7181e052832716b0aac5
Parents: f033d30
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Feb 17 09:41:07 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Feb 17 09:41:07 2014 +0200
----------------------------------------------------------------------
pom.xml | 4 ++--
wicket-native-websocket/wicket-native-websocket-javax/pom.xml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/efb0d458/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d42b54b..b4d4720 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,9 +30,9 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mvn.build.java.version>1.7</mvn.build.java.version>
- <jacoco.version>0.6.3.201306030806</jacoco.version>
+ <jacoco.version>0.6.4.201312101107</jacoco.version>
<jetty.version>8.1.14.v20131031</jetty.version>
- <jetty9.version>9.0.6.v20130930</jetty9.version>
+ <jetty9.version>9.0.7.v20131107</jetty9.version>
<spring.version>4.0.1.RELEASE</spring.version>
<servlet-api.version>3.0.1</servlet-api.version>
<maven.javadoc.version>2.9.1</maven.javadoc.version>
http://git-wip-us.apache.org/repos/asf/wicket/blob/efb0d458/wicket-native-websocket/wicket-native-websocket-javax/pom.xml
----------------------------------------------------------------------
diff --git a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml
index bb8b2a8..de6b719 100644
--- a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml
+++ b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml
@@ -31,7 +31,7 @@
<description>Provides the common code needed for the different integrations with web container's WebSocket implementations</description>
<properties>
- <jetty.version>9.1.0.v20131115</jetty.version>
+ <jetty.version>9.1.2.v20140210</jetty.version>
</properties>
<dependencies>
[06/17] git commit: Small simplification of iframe's onload listener
- use jQuery.one()
Posted by mg...@apache.org.
Small simplification of iframe's onload listener - use jQuery.one()
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/5bc5ef21
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/5bc5ef21
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/5bc5ef21
Branch: refs/heads/sandbox/component-queueing-2
Commit: 5bc5ef21f4b630e0c9ecd9f35f3e5b31bcc0a0e3
Parents: abeb2af
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Feb 17 14:27:34 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Feb 17 14:27:34 2014 +0200
----------------------------------------------------------------------
wicket-examples/src/main/webapp/js-test/lib/gym.js | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/5bc5ef21/wicket-examples/src/main/webapp/js-test/lib/gym.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/lib/gym.js b/wicket-examples/src/main/webapp/js-test/lib/gym.js
index f2171a1..34dd842 100644
--- a/wicket-examples/src/main/webapp/js-test/lib/gym.js
+++ b/wicket-examples/src/main/webapp/js-test/lib/gym.js
@@ -56,8 +56,7 @@
_getIframe()
.off('load')
- .on('load', function() {
- $(this).off('load');
+ .one('load', function() {
var newIframe, $$;
@@ -121,4 +120,4 @@
click: click,
ajaxClick: ajaxClick
};
-})($q);
\ No newline at end of file
+})($q);
[16/17] git commit: WICKET-5498 OutputComponentPath Html5 compliance
Posted by mg...@apache.org.
WICKET-5498 OutputComponentPath Html5 compliance
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/f1e84a79
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/f1e84a79
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/f1e84a79
Branch: refs/heads/sandbox/component-queueing-2
Commit: f1e84a7999da0904aa7f2ef5cdbebe4fb05eb9d8
Parents: 77cee0a
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Feb 18 11:30:28 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Feb 18 11:30:28 2014 +0200
----------------------------------------------------------------------
.../main/java/org/apache/wicket/Component.java | 11 ++-
.../apache/wicket/settings/DebugSettings.java | 38 ++++++++++
.../wicket/settings/DebugSettingsTest.java | 77 ++++++++++++++++++++
.../wicket/settings/ISecuritySettingsTest.java | 2 +-
4 files changed, 126 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/f1e84a79/wicket-core/src/main/java/org/apache/wicket/Component.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java
index a49596e..e1b256f 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Component.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Component.java
@@ -3915,7 +3915,16 @@ public abstract class Component
tag.putInternal(MARKUP_ID_ATTR_NAME, getMarkupId());
}
- if (getApplication().getDebugSettings().isOutputComponentPath())
+ DebugSettings debugSettings = getApplication().getDebugSettings();
+ String componentPathAttributeName = debugSettings.getComponentPathAttributeName();
+ if (Strings.isEmpty(componentPathAttributeName) == false)
+ {
+ String path = getPageRelativePath();
+ path = path.replace("_", "__");
+ path = path.replace(':', '_');
+ tag.put(componentPathAttributeName, path);
+ }
+ else if (debugSettings.isOutputComponentPath())
{
String path = getPageRelativePath();
path = path.replace("_", "__");
http://git-wip-us.apache.org/repos/asf/wicket/blob/f1e84a79/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
index 5be4213..8aa8782 100644
--- a/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
+++ b/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java
@@ -58,6 +58,8 @@ public class DebugSettings
private boolean outputComponentPath = false;
+ private String componentPathAttributeName = null;
+
private boolean developmentUtilitiesEnabled = false;
/**
@@ -184,7 +186,9 @@ public class DebugSettings
* @see #setOutputComponentPath(boolean)
* @return <code>true</code> if output component path feature is enabled, <code>false</code>
* otherwise
+ * @deprecated Use #getComponentPathAttributeName() instead
*/
+ @Deprecated
public boolean isOutputComponentPath()
{
return outputComponentPath;
@@ -196,7 +200,9 @@ public class DebugSettings
*
* @param outputComponentPath
* @return {@code this} object for chaining
+ * @deprecated Use #setComponentPathAttributeName() with a non-empty value
*/
+ @Deprecated
public DebugSettings setOutputComponentPath(boolean outputComponentPath)
{
this.outputComponentPath = outputComponentPath;
@@ -204,6 +210,38 @@ public class DebugSettings
}
/**
+ * If the parameter value is non-empty then Wicket will use it as the name of an attribute of the
+ * component tag to print the {@link org.apache.wicket.Component}'s path.
+ * This can be useful for debugging and automating tests.
+ *
+ * For example: if {@code componentPathAttributeName} is 'data-wicket-path' then Wicket will add
+ * an attribute to the {@link org.apache.wicket.markup.ComponentTag} for each component with name
+ * 'data-wicket-path' and as a value the component's
+ * {@link org.apache.wicket.Component#getPageRelativePath() page relative path}.
+ *
+ * @param componentPathAttributeName
+ * The name of the attribute for the {@link org.apache.wicket.markup.ComponentTag}.
+ * If {@code null} or empty then the attribute won't be rendered
+ * @return {@code this} object for chaining
+ */
+ public DebugSettings setComponentPathAttributeName(String componentPathAttributeName)
+ {
+ this.componentPathAttributeName = componentPathAttributeName;
+ return this;
+ }
+
+ /**
+ * @see #setComponentPathAttributeName(String)
+ * @return The name of the attribute for the {@link org.apache.wicket.markup.ComponentTag}.
+ * If {@code null} or empty then the attribute won't be rendered
+ */
+ public String getComponentPathAttributeName()
+ {
+ return componentPathAttributeName;
+ }
+
+
+ /**
* Enables all of the panels and pages, etc, from wicket-devutils package.
*
* @param enable
http://git-wip-us.apache.org/repos/asf/wicket/blob/f1e84a79/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java b/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
new file mode 100644
index 0000000..510c44a
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/settings/DebugSettingsTest.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.settings;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.MockPageWithLink;
+import org.apache.wicket.WicketTestCase;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.util.tester.TagTester;
+import org.junit.Test;
+
+/**
+ * Tests for DebugSettings
+ */
+public class DebugSettingsTest extends WicketTestCase
+{
+ /**
+ * https://issues.apache.org/jira/browse/WICKET-5498
+ */
+ @Test
+ public void setComponentPathAttributeName()
+ {
+ String attributeName = "data-wicket-path";
+ tester.getApplication().getDebugSettings().setComponentPathAttributeName(attributeName);
+ MockPageWithLink page = new MockPageWithLink();
+ Component link = new Link(MockPageWithLink.LINK_ID)
+ {
+ @Override
+ public void onClick()
+ {
+ }
+ }.setMarkupId(MockPageWithLink.LINK_ID);
+ page.add(link);
+ tester.startPage(page);
+
+ TagTester tagTester = tester.getTagById(MockPageWithLink.LINK_ID);
+ String wicketPath = tagTester.getAttribute(attributeName);
+ assertEquals(link.getPageRelativePath(), wicketPath);
+ }
+
+ /**
+ * https://issues.apache.org/jira/browse/WICKET-5498
+ */
+ @Test
+ public void setComponentPathAttributeNameDeprected()
+ {
+ tester.getApplication().getDebugSettings().setOutputComponentPath(true);
+ MockPageWithLink page = new MockPageWithLink();
+ Component link = new Link(MockPageWithLink.LINK_ID)
+ {
+ @Override
+ public void onClick()
+ {
+ }
+ }.setMarkupId(MockPageWithLink.LINK_ID);
+ page.add(link);
+ tester.startPage(page);
+
+ TagTester tagTester = tester.getTagById(MockPageWithLink.LINK_ID);
+ String wicketPath = tagTester.getAttribute("wicketpath");
+ assertEquals(link.getPageRelativePath(), wicketPath);
+ }
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/f1e84a79/wicket-core/src/test/java/org/apache/wicket/settings/ISecuritySettingsTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/settings/ISecuritySettingsTest.java b/wicket-core/src/test/java/org/apache/wicket/settings/ISecuritySettingsTest.java
index 3c44692..66c733f 100644
--- a/wicket-core/src/test/java/org/apache/wicket/settings/ISecuritySettingsTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/settings/ISecuritySettingsTest.java
@@ -28,7 +28,7 @@ import org.apache.wicket.request.flow.RedirectToUrlException;
import org.junit.Test;
/**
- * Tests for {@link ISecuritySettings}
+ * Tests for {@link SecuritySettings}
*/
public class ISecuritySettingsTest extends WicketTestCase
{
[13/17] git commit: WICKET-5505 DefaultPropertyResolver does not
respect JavaBean conventions
Posted by mg...@apache.org.
WICKET-5505 DefaultPropertyResolver does not respect JavaBean conventions
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/6cceff44
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/6cceff44
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/6cceff44
Branch: refs/heads/sandbox/component-queueing-2
Commit: 6cceff44098a0183f0c9f632af93b3205db4ac22
Parents: a69e7ed
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Feb 18 10:42:42 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Feb 18 10:42:42 2014 +0200
----------------------------------------------------------------------
.../validation/DefaultPropertyResolver.java | 20 +++++++++++++--
.../validation/DefaultPropertyResolverTest.java | 27 ++++++++++++++++++++
2 files changed, 45 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/6cceff44/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultPropertyResolver.java
----------------------------------------------------------------------
diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultPropertyResolver.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultPropertyResolver.java
index 91eb1a3..442bca2 100644
--- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultPropertyResolver.java
+++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultPropertyResolver.java
@@ -3,6 +3,7 @@ package org.apache.wicket.bean.validation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.IPropertyReflectionAwareModel;
@@ -50,11 +51,26 @@ public class DefaultPropertyResolver implements IPropertyResolver
return new Property(field.getDeclaringClass(), field.getName());
}
+ String name;
Method getter = delegate.getPropertyGetter();
if (getter != null)
{
- String name = getter.getName().substring(3, 4).toLowerCase() +
- getter.getName().substring(4);
+ String methodName = getter.getName();
+ if (methodName.startsWith("get"))
+ {
+ name = methodName.substring(3, 4).toLowerCase() +
+ methodName.substring(4);
+ }
+ else if (methodName.startsWith("is"))
+ {
+ name = methodName.substring(2, 3).toLowerCase() +
+ methodName.substring(3);
+ }
+ else
+ {
+ throw new WicketRuntimeException("Invalid name for a getter method: '"
+ + methodName + "'. It must start either with 'get' or 'is'.");
+ }
return new Property(getter.getDeclaringClass(), name);
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/6cceff44/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/DefaultPropertyResolverTest.java
----------------------------------------------------------------------
diff --git a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/DefaultPropertyResolverTest.java b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/DefaultPropertyResolverTest.java
index fe4653f..07bbe65 100644
--- a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/DefaultPropertyResolverTest.java
+++ b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/DefaultPropertyResolverTest.java
@@ -53,6 +53,22 @@ public class DefaultPropertyResolverTest
assertThat(property.getOwner().getName(), is(Bean1.class.getName()));
}
+ /**
+ * https://issues.apache.org/jira/browse/WICKET-5505
+ */
+ @Test
+ public void booleanHasFieldAndGetter()
+ {
+ DefaultPropertyResolver resolver = new DefaultPropertyResolver();
+
+ TextField<?> component = new TextField<>("id", new PropertyModel<BooleanBean>(new BooleanBean(),
+ "foo"));
+ Property property = resolver.resolveProperty(component);
+ assertThat(property, not(nullValue()));
+ assertThat(property.getName(), is("foo"));
+ assertThat(property.getOwner().getName(), is(BooleanBean.class.getName()));
+ }
+
@Test
public void hasOnlyField()
{
@@ -93,4 +109,15 @@ public class DefaultPropertyResolverTest
}
}
+ /**
+ * WICKET-5505
+ */
+ public static class BooleanBean
+ {
+ public boolean isFoo()
+ {
+ return false;
+ }
+ }
+
}
[14/17] git commit: Minor optimization
Posted by mg...@apache.org.
Minor optimization
Replace usage of String#replace(String, String) with String#replace(char, char) where possible. The first uses Regex and is slower
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/7f8c6727
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/7f8c6727
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/7f8c6727
Branch: refs/heads/sandbox/component-queueing-2
Commit: 7f8c6727941d51aa8d3ff8a84d37ba5bf110df92
Parents: 6cceff4
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Feb 18 11:01:33 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Feb 18 11:01:33 2014 +0200
----------------------------------------------------------------------
wicket-core/src/main/java/org/apache/wicket/Component.java | 2 +-
.../src/main/java/org/apache/wicket/util/cookies/CookieUtils.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/7f8c6727/wicket-core/src/main/java/org/apache/wicket/Component.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java
index cc31e88..a49596e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Component.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Component.java
@@ -3919,7 +3919,7 @@ public abstract class Component
{
String path = getPageRelativePath();
path = path.replace("_", "__");
- path = path.replace(":", "_");
+ path = path.replace(':', '_');
tag.put("wicketpath", path);
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/7f8c6727/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java b/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java
index ad4b72f..401fe38 100644
--- a/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java
+++ b/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java
@@ -211,7 +211,7 @@ public class CookieUtils
// cookie names cannot contain ':',
// we replace ':' with '.' but first we have to encode '.' as '..'
key = key.replace(".", "..");
- key = key.replace(":", ".");
+ key = key.replace(':', '.');
return key;
}
[10/17] git commit: WICKET-5508 Memory model improvements for Session
fields
Posted by mg...@apache.org.
WICKET-5508 Memory model improvements for Session fields
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/c78379f4
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/c78379f4
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/c78379f4
Branch: refs/heads/sandbox/component-queueing-2
Commit: c78379f4ba3fdd58c574a610db3e85e616860d10
Parents: 87df7f4
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Feb 18 10:13:20 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Feb 18 10:13:20 2014 +0200
----------------------------------------------------------------------
.../main/java/org/apache/wicket/Session.java | 86 +++++++++++++-------
1 file changed, 55 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/c78379f4/wicket-core/src/main/java/org/apache/wicket/Session.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/Session.java b/wicket-core/src/main/java/org/apache/wicket/Session.java
index 37de3f3..147351b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Session.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Session.java
@@ -23,6 +23,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
import org.apache.wicket.application.IClassResolver;
import org.apache.wicket.authorization.IAuthorizationStrategy;
@@ -40,6 +42,7 @@ import org.apache.wicket.session.ISessionStore;
import org.apache.wicket.util.IProvider;
import org.apache.wicket.util.LazyInitializer;
import org.apache.wicket.util.io.IClusterable;
+import org.apache.wicket.util.lang.Args;
import org.apache.wicket.util.lang.Objects;
import org.apache.wicket.util.time.Duration;
import org.slf4j.Logger;
@@ -114,10 +117,10 @@ public abstract class Session implements IClusterable, IEventSink
public static final String SESSION_ATTRIBUTE_NAME = "session";
/** a sequence used for whenever something session-specific needs a unique value */
- private int sequence = 1;
+ private final AtomicInteger sequence = new AtomicInteger(1);
/** a sequence used for generating page IDs */
- private int pageId = 0;
+ private final AtomicInteger pageId = new AtomicInteger(0);
/** synchronize page's access by session */
private final IProvider<PageAccessSynchronizer> pageAccessSynchronizer;
@@ -174,7 +177,7 @@ public abstract class Session implements IClusterable, IEventSink
protected ClientInfo clientInfo;
/** True if session state has been changed */
- private transient boolean dirty = false;
+ private transient volatile boolean dirty = false;
/** feedback messages */
private final FeedbackMessages feedbackMessages = new FeedbackMessages();
@@ -183,13 +186,13 @@ public abstract class Session implements IClusterable, IEventSink
private String id = null;
/** The locale to use when loading resources for this session. */
- private Locale locale;
+ private final AtomicReference<Locale> locale;
/** Application level meta data. */
private MetaDataEntry<?>[] metaData;
/** True, if session has been invalidated */
- private transient boolean sessionInvalidated = false;
+ private transient volatile boolean sessionInvalidated = false;
/**
* Temporary instance of the session store. Should be set on each request as it is not supposed
@@ -198,7 +201,7 @@ public abstract class Session implements IClusterable, IEventSink
private transient ISessionStore sessionStore;
/** Any special "skin" style to use when loading resources. */
- private String style;
+ private final AtomicReference<String> style = new AtomicReference<>();
/**
* Holds attributes for sessions that are still temporary/ not bound to a session store. Only
@@ -219,12 +222,13 @@ public abstract class Session implements IClusterable, IEventSink
*/
public Session(Request request)
{
- locale = request.getLocale();
+ Locale locale = request.getLocale();
if (locale == null)
{
throw new IllegalStateException(
"Request#getLocale() cannot return null, request has to have a locale set on it");
}
+ this.locale = new AtomicReference<>(locale);
pageAccessSynchronizer = new PageAccessSynchronizerProvider();
}
@@ -402,7 +406,7 @@ public abstract class Session implements IClusterable, IEventSink
*/
public Locale getLocale()
{
- return locale;
+ return locale.get();
}
/**
@@ -443,7 +447,7 @@ public abstract class Session implements IClusterable, IEventSink
*/
public final String getStyle()
{
- return style;
+ return style.get();
}
/**
@@ -565,15 +569,13 @@ public abstract class Session implements IClusterable, IEventSink
*/
public Session setLocale(final Locale locale)
{
- if (locale == null)
- {
- throw new IllegalArgumentException("Argument 'locale' must not be null");
- }
- if (!Objects.equal(this.locale, locale))
+ Args.notNull(locale, "locale");
+
+ if (!Objects.equal(getLocale(), locale))
{
+ this.locale.set(locale);
dirty();
}
- this.locale = locale;
return this;
}
@@ -605,8 +607,11 @@ public abstract class Session implements IClusterable, IEventSink
*/
public final Session setStyle(final String style)
{
- this.style = style;
- dirty();
+ if (!Objects.equal(getStyle(), style))
+ {
+ this.style.set(style);
+ dirty();
+ }
return this;
}
@@ -682,11 +687,36 @@ public abstract class Session implements IClusterable, IEventSink
}
/**
- * Marks session state as dirty so that it will be flushed at the end of the request.
+ * Marks session state as dirty so that it will be (re)stored in the ISessionStore
+ * at the end of the request.
+ * <strong>Note</strong>: binds the session if it is temporary
*/
public final void dirty()
{
- dirty = true;
+ dirty(true);
+ }
+
+ /**
+ * Marks session state as dirty so that it will be re-stored in the ISessionStore
+ * at the end of the request.
+ *
+ * @param forced
+ * A flag indicating whether the session should be marked as dirty even
+ * when it is temporary. If {@code true} the Session will be bound.
+ */
+ public final void dirty(boolean forced)
+ {
+ if (isTemporary())
+ {
+ if (forced)
+ {
+ dirty = true;
+ }
+ }
+ else
+ {
+ dirty = true;
+ }
}
/**
@@ -839,26 +869,20 @@ public abstract class Session implements IClusterable, IEventSink
*
* @return session-unique value
*/
- public synchronized int nextSequenceValue()
+ public int nextSequenceValue()
{
- if (isTemporary() == false)
- {
- dirty();
- }
- return sequence++;
+ dirty(false);
+ return sequence.getAndIncrement();
}
/**
*
* @return the next page id
*/
- public synchronized int nextPageId()
+ public int nextPageId()
{
- if (isTemporary() == false)
- {
- dirty();
- }
- return pageId++;
+ dirty(false);
+ return pageId.getAndIncrement();
}
/**
[15/17] git commit: Java 7 multi-catch
Posted by mg...@apache.org.
Java 7 multi-catch
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/77cee0a0
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/77cee0a0
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/77cee0a0
Branch: refs/heads/sandbox/component-queueing-2
Commit: 77cee0a07e2b30c3aaa6229c51d2214ca087e412
Parents: 7f8c672
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Feb 18 11:02:31 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Feb 18 11:02:31 2014 +0200
----------------------------------------------------------------------
.../java/org/apache/wicket/util/encoding/UrlEncoder.java | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/77cee0a0/wicket-util/src/main/java/org/apache/wicket/util/encoding/UrlEncoder.java
----------------------------------------------------------------------
diff --git a/wicket-util/src/main/java/org/apache/wicket/util/encoding/UrlEncoder.java b/wicket-util/src/main/java/org/apache/wicket/util/encoding/UrlEncoder.java
index 61e57a6..fb26bc4 100644
--- a/wicket-util/src/main/java/org/apache/wicket/util/encoding/UrlEncoder.java
+++ b/wicket-util/src/main/java/org/apache/wicket/util/encoding/UrlEncoder.java
@@ -265,11 +265,7 @@ public class UrlEncoder
{
charset = Charset.forName(charsetName);
}
- catch (IllegalCharsetNameException e)
- {
- throw new RuntimeException(new UnsupportedEncodingException(charsetName));
- }
- catch (UnsupportedCharsetException e)
+ catch (IllegalCharsetNameException | UnsupportedCharsetException e)
{
throw new RuntimeException(new UnsupportedEncodingException(charsetName));
}
@@ -285,7 +281,7 @@ public class UrlEncoder
}
// System.out.println("Examining character: " + c);
- if ((stopEncoding == true) || dontNeedEncoding.get(c))
+ if (stopEncoding || dontNeedEncoding.get(c))
{
if (c == ' ')
{
@@ -360,4 +356,4 @@ public class UrlEncoder
return out.toString();
}
-}
\ No newline at end of file
+}
[11/17] git commit: WICKET-5510 Avoid using jQuery.text() when
possible. It is very slow in IE
Posted by mg...@apache.org.
WICKET-5510 Avoid using jQuery.text() when possible. It is very slow in IE
(cherry picked from commit 36d1901cf556e9d1941a0a662ac2c3735ed8e6a5)
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b27019fb
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b27019fb
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b27019fb
Branch: refs/heads/sandbox/component-queueing-2
Commit: b27019fb059ae92b2f55afebdda905ea2f8f69da
Parents: c78379f
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Feb 18 10:21:57 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Feb 18 10:24:36 2014 +0200
----------------------------------------------------------------------
.../apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/b27019fb/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index bbe1797..43ff3a4 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -1027,6 +1027,8 @@
context.steps.push(function (notify) {
// get the component id
var compId = node.getAttribute("id");
+
+ // get existing component
var element = Wicket.$(compId);
if (isUndef(element)) {
@@ -1034,7 +1036,7 @@
compId + "]] was not found while trying to perform markup update. " +
"Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update.");
} else {
- var text = jQuery(node).text();
+ var text = Wicket.DOM.text(node);
// if the text was escaped, unescape it
// (escaping is done when the component body contains a CDATA section)
@@ -1146,7 +1148,7 @@
// Adds a closure that processes a redirect
processRedirect: function (context, node) {
- var text = jQuery(node).text();
+ var text = Wicket.DOM.text(node);
Wicket.Log.info("Redirecting to: " + text);
window.location = text;
},
@@ -1748,8 +1750,10 @@
},
/**
- * Reads the text from the node's children nodes
- * @param node the root node
+ * Reads the text from the node's children nodes.
+ * Used instead of jQuery.text() because it is very slow in IE10/11.
+ * WICKET-5132, WICKET-5510
+ * @param node {DOMElement} the root node
*/
text: function (node) {
if (isUndef(node)) {
@@ -1913,7 +1917,7 @@
// need to replace that first
// get the header contribution text and unescape it if necessary
- var text = jQuery(headerNode).text();
+ var text = Wicket.DOM.text(headerNode);
var encoding = headerNode.getAttribute("encoding");
if (encoding !== null && encoding !== "") {
[04/17] git commit: Update maven-project-info-reports-plugin to 2.7
Posted by mg...@apache.org.
Update maven-project-info-reports-plugin to 2.7
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/0843d281
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/0843d281
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/0843d281
Branch: refs/heads/sandbox/component-queueing-2
Commit: 0843d281d120efe4367d5998f087baf791b7839b
Parents: e9b4f38
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Feb 17 14:14:35 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Feb 17 14:14:35 2014 +0200
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/0843d281/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b4d4720..178fd6b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -929,7 +929,7 @@
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.6</version>
+ <version>2.7</version>
<reportSets>
<reportSet>
<reports>
[09/17] git commit: WICKET-5504
AjaxRequestTarget.append/prependJavaScript cannot handle scripts with
new-lines anymore
Posted by mg...@apache.org.
WICKET-5504 AjaxRequestTarget.append/prependJavaScript cannot handle scripts with new-lines anymore
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/87df7f44
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/87df7f44
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/87df7f44
Branch: refs/heads/sandbox/component-queueing-2
Commit: 87df7f443d4d5403fb304fc1272953189d411596
Parents: 32a665d
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Feb 17 22:14:32 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Feb 17 22:14:32 2014 +0200
----------------------------------------------------------------------
.../main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 2 +-
.../src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/87df7f44/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index 3f769d7..bbe1797 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -1066,7 +1066,7 @@
* when there are scripts which require manual call of 'FunctionExecutor#notify()'
* @type {RegExp}
*/
- var scriptSplitterR = new RegExp("\\(function\\(\\)\\{.*?}\\)\\(\\);", 'gi');
+ var scriptSplitterR = new RegExp("\\(function\\(\\)\\{[\\s\\S]*?}\\)\\(\\);", 'gi');
// get the javascript body
var text = Wicket.DOM.text(node);
http://git-wip-us.apache.org/repos/asf/wicket/blob/87df7f44/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml b/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
index 04698b2..c8155c3 100644
--- a/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
+++ b/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
@@ -15,4 +15,5 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<ajax-response><evaluate>(function(){ignored|start(); ok(true, 'Evaluation with identifier must be executed!'); equal(typeof(ignored), 'function', 'The passed identifier must be a function'); arguments[0]();})();</evaluate></ajax-response>
\ No newline at end of file
+<ajax-response><evaluate>(function(){ignored|start(); ok(true, 'Evaluation with identifier must be executed!');
+ equal(typeof(ignored), 'function', 'The passed identifier must be a function'); arguments[0]();})();</evaluate></ajax-response>
[03/17] git commit: Sync the CDI example with the one from wicket-6.x
Posted by mg...@apache.org.
Sync the CDI example with the one from wicket-6.x
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/e9b4f388
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/e9b4f388
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/e9b4f388
Branch: refs/heads/sandbox/component-queueing-2
Commit: e9b4f388aef1d9c18988689170c460b0c436f128
Parents: af7d79b
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Feb 17 14:14:05 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Feb 17 14:14:05 2014 +0200
----------------------------------------------------------------------
.../examples/cdi/AutoConversationPage1.html | 19 +++++++
.../examples/cdi/AutoConversationPage1.java | 57 ++++++++++++++++++++
.../examples/cdi/AutoConversationPage2.html | 17 ++++++
.../examples/cdi/AutoConversationPage2.java | 43 +++++++++++++++
.../wicket/examples/cdi/CdiApplication.java | 20 +++----
.../apache/wicket/examples/cdi/CdiHomePage.html | 3 ++
6 files changed, 150 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/e9b4f388/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.html
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.html
new file mode 100644
index 0000000..5768bab
--- /dev/null
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.html
@@ -0,0 +1,19 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+<body>
+<wicket:extend>
+ <p>
+ This page demonstrates automatic conversation managed. Below is a counter
+ that is conversation-scoped. Click increment a couple of times and then click
+ the 'Continue to next page', the counter value should persist on the
+ next page.
+ </p>
+ <p>
+ Current counter value is: <span wicket:id="count">100</span>
+ <a wicket:id="increment">increment</a>
+ </p>
+ <p>
+ <a wicket:id="next">Continue to next page</a>
+ </p>
+</wicket:extend>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/wicket/blob/e9b4f388/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.java
new file mode 100644
index 0000000..fd5190d
--- /dev/null
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.examples.cdi;
+
+import javax.enterprise.context.Conversation;
+import javax.inject.Inject;
+
+import org.apache.wicket.cdi.ConversationalComponent;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+public class AutoConversationPage1 extends CdiExamplePage implements ConversationalComponent
+{
+ @Inject
+ ConversationCounter counter;
+
+ @Inject
+ Conversation conversation;
+
+ public AutoConversationPage1()
+ {
+ add(new Label("count", new PropertyModel(this, "counter.count")));
+
+ add(new Link<Void>("increment")
+ {
+ @Override
+ public void onClick()
+ {
+ counter.increment();
+ }
+ });
+
+ add(new Link<Void>("next")
+ {
+ @Override
+ public void onClick()
+ {
+ setResponsePage(new AutoConversationPage2());
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/e9b4f388/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.html
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.html
new file mode 100644
index 0000000..1e1a9ef
--- /dev/null
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.html
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+<body>
+<wicket:extend>
+ <p>
+ This page is not marked with ConversationalComponent. Therefore, the conversation that was
+ started on the previous page is ended. Notice the conversational counter injected into this
+ page initially has the same value as in the previous page, this is because the conversation
+ was still active in the request that rendered this page. However, clicking 'refresh' below,
+ will reset the counter to 0.
+ </p>
+ <p>
+ Current counter value is: <span wicket:id="count">100</span>
+ <a wicket:id="refresh">refresh</a>
+ </p>
+</wicket:extend>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/wicket/blob/e9b4f388/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.java
new file mode 100644
index 0000000..7f3ee95
--- /dev/null
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.examples.cdi;
+
+import javax.inject.Inject;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+public class AutoConversationPage2 extends CdiExamplePage
+{
+ @Inject
+ ConversationCounter counter;
+
+ public AutoConversationPage2()
+ {
+ add(new Label("count", new PropertyModel(this, "counter.count")));
+
+ add(new Link<Void>("refresh")
+ {
+ @Override
+ public void onClick()
+ {
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/e9b4f388/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java
index a5c4869..c56d2e7 100644
--- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java
@@ -16,27 +16,29 @@
*/
package org.apache.wicket.examples.cdi;
+import javax.enterprise.inject.spi.BeanManager;
+
import org.apache.wicket.Page;
import org.apache.wicket.cdi.CdiConfiguration;
-import org.apache.wicket.cdi.ConversationPropagation;
import org.apache.wicket.protocol.http.WebApplication;
+import org.jboss.weld.environment.servlet.Listener;
-public class CdiApplication extends WebApplication {
+public class CdiApplication extends WebApplication
+{
@Override
- public Class<? extends Page> getHomePage() {
+ public Class<? extends Page> getHomePage()
+ {
return CdiHomePage.class;
}
@Override
- protected void init() {
+ protected void init()
+ {
super.init();
- new CdiConfiguration().setPropagation(
- ConversationPropagation.NONBOOKMARKABLE).configure(this);
-
- mountPage("injection", InjectionPage.class);
- mountPage("conversation", ConversationPage1.class);
+ // configure wicket/cdi
+ new CdiConfiguration().configure(this);
}
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/e9b4f388/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.html
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.html
index ef2431a..d750a11 100644
--- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.html
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.html
@@ -9,6 +9,9 @@
<li>
<a href="ConversationPage1.html">Conversation Propagation Example</a>
</li>
+ <li>
+ <a href="AutoConversationPage1.html">Automatic Conversation Management Example</a>
+ </li>
</ul>
</wicket:link>
</wicket:extend>
[07/17] git commit: Add Gym tests for Mail Template
Posted by mg...@apache.org.
Add Gym tests for Mail Template
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/af235394
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/af235394
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/af235394
Branch: refs/heads/sandbox/component-queueing-2
Commit: af23539431d56e781f77f8fecbcfa987d37e4082
Parents: 5bc5ef2
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Feb 17 16:58:34 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Feb 17 16:58:34 2014 +0200
----------------------------------------------------------------------
Gruntfile.js | 4 +
.../wicket/examples/asemail/MailTemplate.html | 4 +-
.../src/main/webapp/js-test/all.html | 2 +
.../main/webapp/js-test/tests/mailtemplate.js | 85 ++++++++++++++++++++
4 files changed, 93 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/af235394/Gruntfile.js
----------------------------------------------------------------------
diff --git a/Gruntfile.js b/Gruntfile.js
index 642bf12..0459f6c 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -52,6 +52,9 @@ module.exports = function(grunt) {
"./wicket-core/src/test/js/event.js",
"./wicket-core/src/test/js/amd.js"
],
+ gymTestsJs = [
+ "wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js"
+ ],
gruntJs = [
"Gruntfile.js"
];
@@ -67,6 +70,7 @@ module.exports = function(grunt) {
nativeWebSocket: nativeWebSocketJs,
atmosphere: atmosphereJs,
testsJs: testsJs,
+ gymTestsJs: gymTestsJs,
grunt: gruntJs,
options: {
http://git-wip-us.apache.org/repos/asf/wicket/blob/af235394/wicket-examples/src/main/java/org/apache/wicket/examples/asemail/MailTemplate.html
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/asemail/MailTemplate.html b/wicket-examples/src/main/java/org/apache/wicket/examples/asemail/MailTemplate.html
index 16f2914..75761c6 100644
--- a/wicket-examples/src/main/java/org/apache/wicket/examples/asemail/MailTemplate.html
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/asemail/MailTemplate.html
@@ -21,9 +21,9 @@
<br/><br/>
<h3>Here is the generated markup:</h3>
- <div wicket:id="result">
+ <div wicket:id="result" id="result">
</div>
</body>
-</html>
\ No newline at end of file
+</html>
http://git-wip-us.apache.org/repos/asf/wicket/blob/af235394/wicket-examples/src/main/webapp/js-test/all.html
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/all.html b/wicket-examples/src/main/webapp/js-test/all.html
index 9226a00..0a23a16 100644
--- a/wicket-examples/src/main/webapp/js-test/all.html
+++ b/wicket-examples/src/main/webapp/js-test/all.html
@@ -30,6 +30,8 @@
<script type="text/javascript" src="tests/bean-validation/email.js"></script>
<script type="text/javascript" src="tests/bean-validation/phone.js"></script>
<script type="text/javascript" src="tests/bean-validation/birthdate.js"></script>
+
+ <script type="text/javascript" src="tests/mailtemplate.js"></script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/wicket/blob/af235394/wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js b/wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js
new file mode 100644
index 0000000..ac9318c
--- /dev/null
+++ b/wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
+$q(document).ready(function() {
+ "use strict";
+
+ module('Mail Template');
+
+ var text = "Gym.js";
+
+ var generate = function($, linkIndex) {
+
+ var $nameInput = $('input[name=name]');
+
+ $nameInput.val(text);
+
+ return gym.ajaxClick($('a:contains("generate")').eq(linkIndex));
+ };
+
+
+ asyncTest('Page', function () {
+ expect(3);
+
+ gym.load('/mailtemplate').then(function($) {
+ return generate($, 0);
+ }).then(function($) {
+
+ var $resultText = $('#result').text();
+ ok($resultText, 'The page is rendered');
+ ok($resultText.indexOf("<!DOCTYPE html>") > -1, 'The HTML5 doctype is here');
+ ok($resultText.indexOf("Hello, <span wicket:id=\"name\">"+text+"</span>") > -1,
+ 'The entered text is here');
+
+ }).always(start);
+ });
+
+
+ asyncTest('Panel', function () {
+ expect(3);
+
+ gym.load('/mailtemplate').then(function($) {
+ return generate($, 1);
+ }).then(function($) {
+
+ var $resultText = $('#result').text();
+ ok($resultText, 'The panel is rendered');
+ ok($resultText.indexOf("<wicket:panel>") > -1, 'The panel markup is here');
+ ok($resultText.indexOf("Hello, <span wicket:id=\"name\">"+text+"</span>") > -1,
+ 'The entered text is here');
+
+ }).always(start);
+ });
+
+ asyncTest('Text Template', function () {
+ expect(2);
+
+ gym.load('/mailtemplate').then(function($) {
+ return generate($, 2);
+ }).then(function($) {
+
+ var $resultText = $('#result').text();
+ ok($resultText, 'The text template is rendered');
+ ok($resultText.indexOf("Hello "+text) > -1, 'The entered text is here');
+
+ }).always(start);
+ });
+
+});
[17/17] git commit: Merge branch 'master' into
sandbox/component-queueing-2
Posted by mg...@apache.org.
Merge branch 'master' into sandbox/component-queueing-2
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b3c946af
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b3c946af
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b3c946af
Branch: refs/heads/sandbox/component-queueing-2
Commit: b3c946af73abe6301017d7d21f487398c6616540
Parents: 3a3e32a f1e84a7
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Feb 18 12:01:28 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Feb 18 12:01:28 2014 +0200
----------------------------------------------------------------------
Gruntfile.js | 15 ++++
pom.xml | 6 +-
.../validation/DefaultPropertyResolver.java | 20 ++++-
.../validation/DefaultPropertyResolverTest.java | 27 ++++++
.../main/java/org/apache/wicket/Component.java | 13 ++-
.../main/java/org/apache/wicket/Session.java | 86 +++++++++++++-------
.../wicket/ajax/res/js/wicket-ajax-jquery.js | 16 ++--
.../core/util/string/ComponentRenderer.java | 15 +---
.../apache/wicket/settings/DebugSettings.java | 38 +++++++++
.../apache/wicket/util/cookies/CookieUtils.java | 2 +-
.../wicket/settings/DebugSettingsTest.java | 77 ++++++++++++++++++
.../wicket/settings/ISecuritySettingsTest.java | 2 +-
wicket-core/src/test/js/ajax.js | 2 +-
.../data/ajax/evaluationIdentifierAndCodeId.xml | 3 +-
.../wicket/examples/asemail/MailTemplate.html | 4 +-
.../examples/cdi/AutoConversationPage1.html | 19 +++++
.../examples/cdi/AutoConversationPage1.java | 57 +++++++++++++
.../examples/cdi/AutoConversationPage2.html | 17 ++++
.../examples/cdi/AutoConversationPage2.java | 43 ++++++++++
.../wicket/examples/cdi/CdiApplication.java | 18 ++--
.../apache/wicket/examples/cdi/CdiHomePage.html | 3 +
.../src/main/webapp/js-test/all.html | 3 +
.../src/main/webapp/js-test/lib/gym.js | 5 +-
.../src/main/webapp/js-test/tests/ajax/form.js | 3 +
.../js-test/tests/bean-validation/birthdate.js | 5 +-
.../js-test/tests/bean-validation/email.js | 3 +
.../js-test/tests/bean-validation/name.js | 3 +
.../js-test/tests/bean-validation/phone.js | 3 +
.../js-test/tests/cdi/auto-conversation.js | 79 ++++++++++++++++++
.../webapp/js-test/tests/cdi/conversation.js | 5 +-
.../main/webapp/js-test/tests/cdi/injection.js | 5 +-
.../src/main/webapp/js-test/tests/echo.js | 3 +
.../src/main/webapp/js-test/tests/forminput.js | 3 +
.../src/main/webapp/js-test/tests/helloworld.js | 3 +
.../main/webapp/js-test/tests/mailtemplate.js | 85 +++++++++++++++++++
.../wicket-native-websocket-javax/pom.xml | 2 +-
.../apache/wicket/util/encoding/UrlEncoder.java | 10 +--
37 files changed, 622 insertions(+), 81 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/b3c946af/wicket-core/src/main/java/org/apache/wicket/Component.java
----------------------------------------------------------------------
[12/17] git commit: WICKET-5504
AjaxRequestTarget.append/prependJavaScript cannot handle scripts with
new-lines anymore
Posted by mg...@apache.org.
WICKET-5504 AjaxRequestTarget.append/prependJavaScript cannot handle scripts with new-lines anymore
Extend the test to have one evaluation with new lines and another without
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a69e7ed1
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a69e7ed1
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a69e7ed1
Branch: refs/heads/sandbox/component-queueing-2
Commit: a69e7ed1c0256a6ebd0e89749095eed7632e3697
Parents: b27019f
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Feb 18 10:32:29 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Feb 18 10:32:29 2014 +0200
----------------------------------------------------------------------
wicket-core/src/test/js/ajax.js | 2 +-
.../src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/a69e7ed1/wicket-core/src/test/js/ajax.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/ajax.js b/wicket-core/src/test/js/ajax.js
index 5d4aafe..0a8251b 100644
--- a/wicket-core/src/test/js/ajax.js
+++ b/wicket-core/src/test/js/ajax.js
@@ -100,7 +100,7 @@ jQuery(document).ready(function() {
*/
asyncTest('processEvaluation with identifier|code.', function () {
- expect(3);
+ expect(5);
var attrs = {
u: 'data/ajax/evaluationIdentifierAndCodeId.xml',
http://git-wip-us.apache.org/repos/asf/wicket/blob/a69e7ed1/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml b/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
index c8155c3..2fef67e 100644
--- a/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
+++ b/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
@@ -15,5 +15,5 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<ajax-response><evaluate>(function(){ignored|start(); ok(true, 'Evaluation with identifier must be executed!');
- equal(typeof(ignored), 'function', 'The passed identifier must be a function'); arguments[0]();})();</evaluate></ajax-response>
+<ajax-response><evaluate>(function(){ignored|ok(true, 'Evaluation with identifier (with newlines, WICKET-5504) must be executed!');
+ equal(typeof(ignored), 'function', 'The passed identifier must be a function'); arguments[0]();})();</evaluate><evaluate>(function(){ignored|start(); ok(true, 'Evaluation with identifier (without newlines) 2 must be executed!');equal(typeof(ignored), 'function', 'The passed identifier must be a function'); arguments[0]();})();</evaluate></ajax-response>
[05/17] git commit: Add Gym test for the new CDI example - auto
conversation
Posted by mg...@apache.org.
Add Gym test for the new CDI example - auto conversation
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/abeb2af4
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/abeb2af4
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/abeb2af4
Branch: refs/heads/sandbox/component-queueing-2
Commit: abeb2af4a8523ba4c60ef9b3dc8b425f47025d93
Parents: 0843d28
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Feb 17 14:25:47 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Feb 17 14:25:47 2014 +0200
----------------------------------------------------------------------
.../wicket/examples/cdi/CdiApplication.java | 4 ++
.../src/main/webapp/js-test/all.html | 1 +
.../js-test/tests/cdi/auto-conversation.js | 76 ++++++++++++++++++++
3 files changed, 81 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/abeb2af4/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java
index c56d2e7..f6548f4 100644
--- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java
@@ -39,6 +39,10 @@ public class CdiApplication extends WebApplication
// configure wicket/cdi
new CdiConfiguration().configure(this);
+
+ mountPage("injection", InjectionPage.class);
+ mountPage("conversation", ConversationPage1.class);
+ mountPage("autoConversation", AutoConversationPage1.class);
}
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/abeb2af4/wicket-examples/src/main/webapp/js-test/all.html
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/all.html b/wicket-examples/src/main/webapp/js-test/all.html
index 694723f..9226a00 100644
--- a/wicket-examples/src/main/webapp/js-test/all.html
+++ b/wicket-examples/src/main/webapp/js-test/all.html
@@ -24,6 +24,7 @@
<script type="text/javascript" src="tests/ajax/form.js"></script>
<script type="text/javascript" src="tests/cdi/injection.js"></script>
<script type="text/javascript" src="tests/cdi/conversation.js"></script>
+ <script type="text/javascript" src="tests/cdi/auto-conversation.js"></script>
<script type="text/javascript" src="tests/bean-validation/name.js"></script>
<script type="text/javascript" src="tests/bean-validation/email.js"></script>
http://git-wip-us.apache.org/repos/asf/wicket/blob/abeb2af4/wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js b/wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js
new file mode 100644
index 0000000..e391d92
--- /dev/null
+++ b/wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+$q(document).ready(function() {
+ "use strict";
+
+ var countSelector = 'p > span';
+
+ var increment = function($) {
+ return gym.click($('a:contains("increment")'));
+ };
+
+ var nextPage = function($) {
+ return gym.click($('a:contains("Continue to next page")'));
+ };
+
+ var refresh = function($) {
+ return gym.click($('a:contains("refresh")'));
+ };
+
+ module('CDI');
+
+ asyncTest('auto-conversation', function () {
+ expect(4);
+ var initialValue;
+
+ gym.load('/cdi/autoConversation').then(function($) {
+
+ initialValue = $(countSelector).text();
+ initialValue = parseInt(initialValue, 10);
+
+ return increment($);
+ }).then(function($) {
+
+ var counterLabelValue = $(countSelector).text();
+ var expectedValue = initialValue + 1;
+ equal(counterLabelValue, "" + expectedValue, 'The new value of the counter is +1');
+
+ return increment($);
+ }).then(function($) {
+
+ var counterLabelValue = $(countSelector).text();
+ var expectedValue = initialValue + 2;
+ equal(counterLabelValue, "" + expectedValue, 'The new value of the counter is +1');
+
+ return nextPage($);
+ }).then(function($) {
+
+ var counterLabelValue = $(countSelector).text();
+ var expectedValue = initialValue + 2;
+ equal(counterLabelValue, "" + expectedValue, 'The value of the counter is the same as in the previous page');
+
+ return refresh($);
+ }).then(function($) {
+
+ var counterLabelValue = $(countSelector).text();
+ var expectedValue = 0;
+ equal(counterLabelValue, "" + expectedValue, 'The new value of the counter should be 0');
+ }).always(start);
+ });
+
+});
[08/17] git commit: Add all Gym tests as targets to Grunt's JSHint
task
Posted by mg...@apache.org.
Add all Gym tests as targets to Grunt's JSHint task
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/32a665d7
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/32a665d7
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/32a665d7
Branch: refs/heads/sandbox/component-queueing-2
Commit: 32a665d7b6b5422be5fc5bd6ae4cfb6ed146bfd2
Parents: af23539
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Feb 17 17:40:48 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Feb 17 17:40:48 2014 +0200
----------------------------------------------------------------------
Gruntfile.js | 11 +++++++++++
.../src/main/webapp/js-test/tests/ajax/form.js | 3 +++
.../webapp/js-test/tests/bean-validation/birthdate.js | 5 ++++-
.../main/webapp/js-test/tests/bean-validation/email.js | 3 +++
.../main/webapp/js-test/tests/bean-validation/name.js | 3 +++
.../main/webapp/js-test/tests/bean-validation/phone.js | 3 +++
.../main/webapp/js-test/tests/cdi/auto-conversation.js | 3 +++
.../src/main/webapp/js-test/tests/cdi/conversation.js | 5 ++++-
.../src/main/webapp/js-test/tests/cdi/injection.js | 5 ++++-
wicket-examples/src/main/webapp/js-test/tests/echo.js | 3 +++
.../src/main/webapp/js-test/tests/forminput.js | 3 +++
.../src/main/webapp/js-test/tests/helloworld.js | 3 +++
12 files changed, 47 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/Gruntfile.js
----------------------------------------------------------------------
diff --git a/Gruntfile.js b/Gruntfile.js
index 0459f6c..c7fdbb0 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -53,6 +53,17 @@ module.exports = function(grunt) {
"./wicket-core/src/test/js/amd.js"
],
gymTestsJs = [
+ "wicket-examples/src/main/webapp/js-test/tests/ajax/form.js",
+ "wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js",
+ "wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js",
+ "wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js",
+ "wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js",
+ "wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js",
+ "wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js",
+ "wicket-examples/src/main/webapp/js-test/tests/cdi/injection.js",
+ "wicket-examples/src/main/webapp/js-test/tests/echo.js",
+ "wicket-examples/src/main/webapp/js-test/tests/forminput.js",
+ "wicket-examples/src/main/webapp/js-test/tests/helloworld.js",
"wicket-examples/src/main/webapp/js-test/tests/mailtemplate.js"
],
gruntJs = [
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js b/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js
index eb348b1..7c3059f 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/ajax/form.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js
index c442aa6..b8644a2 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/birthdate.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
@@ -72,4 +75,4 @@ $q(document).ready(function() {
}).always(start);
});
-});
\ No newline at end of file
+});
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js
index 5f588e5..2f73ab0 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/email.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js
index dd634ac..ee9eb0d 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/name.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js
index 840c141..70f82e0 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/bean-validation/phone.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js b/wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js
index e391d92..271fdf2 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/cdi/auto-conversation.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js b/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js
index 764824e..0aa080f 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/cdi/conversation.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
@@ -69,4 +72,4 @@ $q(document).ready(function() {
}).always(start);
});
-});
\ No newline at end of file
+});
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/cdi/injection.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/cdi/injection.js b/wicket-examples/src/main/webapp/js-test/tests/cdi/injection.js
index 1a6fbb6..21839a9 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/cdi/injection.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/cdi/injection.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
@@ -52,4 +55,4 @@ $q(document).ready(function() {
}).always(start);
});
-});
\ No newline at end of file
+});
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/echo.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/echo.js b/wicket-examples/src/main/webapp/js-test/tests/echo.js
index 2264f55..77fe1a0 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/echo.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/echo.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/forminput.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/forminput.js b/wicket-examples/src/main/webapp/js-test/tests/forminput.js
index df27b7b..e6b17e6 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/forminput.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/forminput.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
http://git-wip-us.apache.org/repos/asf/wicket/blob/32a665d7/wicket-examples/src/main/webapp/js-test/tests/helloworld.js
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/webapp/js-test/tests/helloworld.js b/wicket-examples/src/main/webapp/js-test/tests/helloworld.js
index 56c5933..db9873e 100644
--- a/wicket-examples/src/main/webapp/js-test/tests/helloworld.js
+++ b/wicket-examples/src/main/webapp/js-test/tests/helloworld.js
@@ -15,6 +15,9 @@
* limitations under the License.
*/
+/*global module: true, ok: true, asyncTest: true, equal: true, expect: true, $q: true,
+ gym: true, start: true */
+
$q(document).ready(function() {
"use strict";
[02/17] git commit: WICKET-5509 Wicket examples' MailTemplate from
Page is broken
Posted by mg...@apache.org.
WICKET-5509 Wicket examples' MailTemplate from Page is broken
Render the page directly without using PageRenderer.
(cherry picked from commit 1772dd88bdbadc848ee74b5dc665b0e419836ff2)
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/af7d79ba
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/af7d79ba
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/af7d79ba
Branch: refs/heads/sandbox/component-queueing-2
Commit: af7d79ba88d623e9d91e47ae383149a01f49d2f1
Parents: efb0d45
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Feb 17 12:32:07 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Feb 17 12:33:27 2014 +0200
----------------------------------------------------------------------
.../wicket/core/util/string/ComponentRenderer.java | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/af7d79ba/wicket-core/src/main/java/org/apache/wicket/core/util/string/ComponentRenderer.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/string/ComponentRenderer.java b/wicket-core/src/main/java/org/apache/wicket/core/util/string/ComponentRenderer.java
index a5582d2..c5e35eb 100644
--- a/wicket-core/src/main/java/org/apache/wicket/core/util/string/ComponentRenderer.java
+++ b/wicket-core/src/main/java/org/apache/wicket/core/util/string/ComponentRenderer.java
@@ -19,8 +19,8 @@ package org.apache.wicket.core.util.string;
import org.apache.wicket.Application;
import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.ThreadContext;
import org.apache.wicket.core.request.handler.PageProvider;
-import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
import org.apache.wicket.markup.IMarkupCacheKeyProvider;
import org.apache.wicket.markup.IMarkupResourceStreamProvider;
import org.apache.wicket.markup.MarkupNotFoundException;
@@ -29,7 +29,6 @@ import org.apache.wicket.protocol.http.BufferedWebResponse;
import org.apache.wicket.request.Response;
import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.request.cycle.RequestCycleContext;
-import org.apache.wicket.request.handler.render.PageRenderer;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.resource.StringResourceStream;
@@ -48,11 +47,7 @@ public class ComponentRenderer
*/
public static CharSequence renderPage(final PageProvider pageProvider)
{
- final RenderPageRequestHandler handler = new RenderPageRequestHandler(pageProvider,
- RenderPageRequestHandler.RedirectPolicy.NEVER_REDIRECT);
-
Application application = Application.get();
- final PageRenderer pageRenderer = application.getPageRendererProvider().get(handler);
RequestCycle originalRequestCycle = RequestCycle.get();
@@ -62,16 +57,14 @@ public class ComponentRenderer
tempResponse, application.getRootRequestMapper(), application.getExceptionMapperProvider().get());
RequestCycle tempRequestCycle = new RequestCycle(requestCycleContext);
- final Response oldResponse = originalRequestCycle.getResponse();
-
try
{
- originalRequestCycle.setResponse(tempResponse);
- pageRenderer.respond(tempRequestCycle);
+ ThreadContext.setRequestCycle(tempRequestCycle);
+ pageProvider.getPageInstance().renderPage();
}
finally
{
- originalRequestCycle.setResponse(oldResponse);
+ ThreadContext.setRequestCycle(originalRequestCycle);
}
return tempResponse.getText();