You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2008/12/21 11:07:30 UTC
svn commit: r728416 - in /wicket/trunk/wicket/src:
main/java/org/apache/wicket/ main/java/org/apache/wicket/markup/resolver/
test/java/org/apache/wicket/markup/resolver/
Author: jdonnerstag
Date: Sun Dec 21 02:07:29 2008
New Revision: 728416
URL: http://svn.apache.org/viewvc?rev=728416&view=rev
Log:
wicket-1750 fixed: Inconsisting Handling of id mismatch on wicket:container
Added:
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPageExpectedResult_1.html
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.html
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.java
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketContainerResolverTest.java
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketContainerResolver.java
Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java?rev=728416&r1=728415&r2=728416&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/MarkupContainer.java Sun Dec 21 02:07:29 2008
@@ -1432,7 +1432,12 @@
}
else
{
- markupStream.throwMarkupException("Failed to handle: " + tag.toString());
+ markupStream.throwMarkupException("Failed to handle: " +
+ tag.toString() +
+ ". It might be that no resolver has been registered to handle this special tag. " +
+ " But it also be that you declared wicket:id=" + id +
+ " in your markup, but that you either did not add the " +
+ "component to your page at all, or that the hierarchy does not match.");
}
}
Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketContainerResolver.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketContainerResolver.java?rev=728416&r1=728415&r2=728416&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketContainerResolver.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketContainerResolver.java Sun Dec 21 02:07:29 2008
@@ -41,8 +41,8 @@
* </code>
*
* Notice that we had to attach the repeater to a component tag - in this case a <code>span</code>,
- * but a span is not a legal tag to nest under <code>table</code>. So we can rewrite the example
- * as following:
+ * but a span is not a legal tag to nest under <code>table</code>. So we can rewrite the example as
+ * following:
*
* <code>
* <table>
@@ -61,15 +61,14 @@
{
private static final Logger log = LoggerFactory.getLogger(WicketContainerResolver.class);
+ private static final long serialVersionUID = 1L;
+
static
{
// register "wicket:container"
WicketTagIdentifier.registerWellKnownTagName("container");
}
-
- private static final long serialVersionUID = 1L;
-
/**
* Try to resolve the tag, then create a component, add it to the container and render it.
*
Added: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPageExpectedResult_1.html
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPageExpectedResult_1.html?rev=728416&view=auto
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPageExpectedResult_1.html (added)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPageExpectedResult_1.html Sun Dec 21 02:07:29 2008
@@ -0,0 +1,10 @@
+<html xmlns:wicket>
+<body>
+ <table>
+ <wicket:container wicket:id="repeater">
+ <tr><td>...</td></tr>
+ <tr><td>...</td></tr>
+ </wicket:container>
+</table>
+</body>
+</html>
Added: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.html
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.html?rev=728416&view=auto
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.html (added)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.html Sun Dec 21 02:07:29 2008
@@ -0,0 +1,10 @@
+<html xmlns:wicket>
+<body>
+ <table>
+ <wicket:container wicket:id="repeater">
+ <tr><td>...</td></tr>
+ <tr><td>...</td></tr>
+ </wicket:container>
+</table>
+</body>
+</html>
Added: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.java?rev=728416&view=auto
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.java (added)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimpleContainerPage_1.java Sun Dec 21 02:07:29 2008
@@ -0,0 +1,38 @@
+/*
+ * 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.markup.resolver;
+
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+
+
+/**
+ * Mock page for testing.
+ *
+ */
+public class SimpleContainerPage_1 extends WebPage
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Construct.
+ */
+ public SimpleContainerPage_1()
+ {
+ add(new WebMarkupContainer("repeater"));
+ }
+}
Added: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketContainerResolverTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketContainerResolverTest.java?rev=728416&view=auto
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketContainerResolverTest.java (added)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/WicketContainerResolverTest.java Sun Dec 21 02:07:29 2008
@@ -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.markup.resolver;
+
+import org.apache.wicket.WicketTestCase;
+
+/**
+ *
+ */
+public class WicketContainerResolverTest extends WicketTestCase
+{
+ /**
+ * Construct.
+ *
+ * @param name
+ */
+ public WicketContainerResolverTest(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * @throws Exception
+ */
+ public void test_1() throws Exception
+ {
+ executeTest(SimpleContainerPage_1.class, "SimpleContainerPageExpectedResult_1.html");
+ }
+}