[jira] [Commented] (WICKET-4008) Improve PropertyResolver to use a parser
[ https://issues.apache.org/jira/browse/WICKET-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15508326#comment-15508326 ] ASF subversion and git services commented on WICKET-4008: - Commit 697052f713345484b93f4ef61163587473b7b202 in wicket's branch refs/heads/WICKET-4008-property-expression-parser from Pedro Henrique Oliveira dos Santos [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=697052f ] WICKET-4008 parser differentiates java identifiers from bean properties > Improve PropertyResolver to use a parser > > > Key: WICKET-4008 > URL: https://issues.apache.org/jira/browse/WICKET-4008 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 6.0.0-beta1 >Reporter: Pedro Santos >Assignee: Pedro Santos >Priority: Trivial > Attachments: WICKET-4004.patch > > > The usage of a parser is a improvement since it will be able to feedback > erroneous property expressions with meaningful exception messages. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-4008 parser differentiates java identifiers from bean properties
Repository: wicket Updated Branches: refs/heads/WICKET-4008-property-expression-parser b0f7da85e -> 697052f71 WICKET-4008 parser differentiates java identifiers from bean properties Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/697052f7 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/697052f7 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/697052f7 Branch: refs/heads/WICKET-4008-property-expression-parser Commit: 697052f713345484b93f4ef61163587473b7b202 Parents: b0f7da8 Author: Pedro Henrique Oliveira dos SantosAuthored: Tue Sep 20 22:09:36 2016 -0300 Committer: Pedro Henrique Oliveira dos Santos Committed: Tue Sep 20 22:09:36 2016 -0300 -- .../core/util/lang/PropertyExpression.java | 70 ++--- .../util/lang/PropertyExpressionParser.java | 69 ++-- .../util/lang/PropertyExpressionParserTest.java | 82 +++- .../wicket/util/lang/PropertyResolverTest.java | 10 ++- 4 files changed, 160 insertions(+), 71 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/697052f7/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java index 635f95e..dab79ec 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java @@ -18,21 +18,76 @@ package org.apache.wicket.core.util.lang; public class PropertyExpression { - Property property; + JavaProperty javaProperty; + BeanProperty beanProperty; CharSequence index; PropertyExpression next; - static class Property + static class BeanProperty + { + CharSequence propertyName; + CharSequence index; + + public BeanProperty() + { + } + + public BeanProperty(String name, String index) + { + this.propertyName = name; + this.index = index; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((index == null) ? 0 : index.hashCode()); + result = prime * result + ((propertyName == null) ? 0 : propertyName.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + BeanProperty other = (BeanProperty)obj; + if (index == null) + { + if (other.index != null) + return false; + } + else if (!index.equals(other.index)) + return false; + if (propertyName == null) + { + if (other.propertyName != null) + return false; + } + else if (!propertyName.equals(other.propertyName)) + return false; + return true; + } + + } + + static class JavaProperty { CharSequence javaIdentifier; CharSequence index; public boolean hasMethodSign; - public Property() + public JavaProperty() { } - public Property(String javaIdentifier, String index, boolean hasMethodSign) + public JavaProperty(String javaIdentifier, String index, boolean hasMethodSign) { this.javaIdentifier = javaIdentifier; this.index = index; @@ -59,7 +114,7 @@ public class PropertyExpression return false; if (getClass() != obj.getClass()) return false; - Property other = (Property)obj; +
[jira] [Commented] (WICKET-4008) Improve PropertyResolver to use a parser
[ https://issues.apache.org/jira/browse/WICKET-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15508046#comment-15508046 ] Pedro Santos commented on WICKET-4008: -- Hi [~mgrigorov], I agree that shouldParsePropertyExpressionsWithSpaceInMethod should pass and that the exception message when parsing "per son" was misleading, thanks. I added the failing test shouldParsePropertyExpressionStartingWithDigits because one can have getter/setters for a property starting with a digit even though it isn't a valid java identifier. My idea is to break the "property" in the grammar into multiple production rules. So: "bean.1property" will be a valid expression having a "bean property" but "bean.1property()" will fail. Proposed grammar: bean property = property name, [ index ] java property = java identifier , [ index | method sign ] map property = index property expression= [ bean property | java property | map property ], { "." , property expression } > Improve PropertyResolver to use a parser > > > Key: WICKET-4008 > URL: https://issues.apache.org/jira/browse/WICKET-4008 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 6.0.0-beta1 >Reporter: Pedro Santos >Assignee: Pedro Santos >Priority: Trivial > Attachments: WICKET-4004.patch > > > The usage of a parser is a improvement since it will be able to feedback > erroneous property expressions with meaningful exception messages. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-4008) Improve PropertyResolver to use a parser
[ https://issues.apache.org/jira/browse/WICKET-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15508009#comment-15508009 ] ASF subversion and git services commented on WICKET-4008: - Commit b0f7da85e45ea4c798366940ec34cd53528cd549 in wicket's branch refs/heads/WICKET-4008-property-expression-parser from Pedro Henrique Oliveira dos Santos [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=b0f7da8 ] WICKET-4008 edge test cases plus breaking property into different types in the grammar > Improve PropertyResolver to use a parser > > > Key: WICKET-4008 > URL: https://issues.apache.org/jira/browse/WICKET-4008 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 6.0.0-beta1 >Reporter: Pedro Santos >Assignee: Pedro Santos >Priority: Trivial > Attachments: WICKET-4004.patch > > > The usage of a parser is a improvement since it will be able to feedback > erroneous property expressions with meaningful exception messages. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-4008 edge test cases plus breaking property into different types in the grammar
Repository: wicket Updated Branches: refs/heads/WICKET-4008-property-expression-parser 2f302dbfd -> b0f7da85e WICKET-4008 edge test cases plus breaking property into different types in the grammar Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b0f7da85 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b0f7da85 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b0f7da85 Branch: refs/heads/WICKET-4008-property-expression-parser Commit: b0f7da85e45ea4c798366940ec34cd53528cd549 Parents: 2f302db Author: Pedro Henrique Oliveira dos SantosAuthored: Tue Sep 20 18:51:37 2016 -0300 Committer: Pedro Henrique Oliveira dos Santos Committed: Tue Sep 20 19:33:01 2016 -0300 -- .../core/util/lang/PropertyExpression.java | 1 + .../util/lang/PropertyExpressionParser.java | 60 .../util/lang/PropertyExpressionParserTest.java | 138 --- .../wicket/util/lang/PropertyResolverTest.java | 113 --- 4 files changed, 222 insertions(+), 90 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/b0f7da85/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java index 2021c21..635f95e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpression.java @@ -19,6 +19,7 @@ package org.apache.wicket.core.util.lang; public class PropertyExpression { Property property; + CharSequence index; PropertyExpression next; static class Property http://git-wip-us.apache.org/repos/asf/wicket/blob/b0f7da85/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java index 08fd061..3ecb81e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java @@ -31,11 +31,14 @@ import org.apache.wicket.core.util.lang.PropertyExpression.Property; * index char = char - "]" * * java identifier= java letter , {java letter or digit} - * method sign= "(" , ")" + * property name = java letter or digit , {java letter or digit} + * method sign= "(" , { " " } , ")" * index = "[" , index char , {index char} , "]" ; * - * property = java identifier , [ index | method sign ]; - * property expression= property , { "." , property expression } ; + * bean property = property name, [ index ] + * java property = java identifier , [ index | method sign ] + * map property = index + * property expression= [ bean property | java property | map property ], { "." , property expression } ; * * * @@ -55,12 +58,17 @@ public class PropertyExpressionParser { currentPosition = nextPosition; currentToken = lookaheadToken; - nextPosition += 1; if (nextPosition >= text.length()) + { + lookaheadToken = END_OF_EXPRESSION; + } else + { + lookaheadToken = text.charAt(nextPosition); + } return currentToken; } @@ -71,7 +79,8 @@ public class PropertyExpressionParser { throw new ParserException("No expression was given to be parsed."); } - else if (text.length() == 1) + currentToken = text.charAt(0); + if (text.length() == 1) { lookaheadToken = END_OF_EXPRESSION; } @@ -79,7 +88,6 @@ public class PropertyExpressionParser { lookaheadToken = text.charAt(1); } - currentToken = text.charAt(0); return expression(); } @@ -87,7 +95,14 @@ public
[jira] [Commented] (WICKET-4008) Improve PropertyResolver to use a parser
[ https://issues.apache.org/jira/browse/WICKET-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507718#comment-15507718 ] ASF subversion and git services commented on WICKET-4008: - Commit 2f302dbfdc7bd60afca76bccbfac81ccbcbf6af1 in wicket's branch refs/heads/WICKET-4008-property-expression-parser from [~mgrigorov] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=2f302db ] WICKET-4008 property expression parser implementation Add some weird test cases > Improve PropertyResolver to use a parser > > > Key: WICKET-4008 > URL: https://issues.apache.org/jira/browse/WICKET-4008 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 6.0.0-beta1 >Reporter: Pedro Santos >Assignee: Pedro Santos >Priority: Trivial > Attachments: WICKET-4004.patch > > > The usage of a parser is a improvement since it will be able to feedback > erroneous property expressions with meaningful exception messages. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-4008 property expression parser implementation
Repository: wicket Updated Branches: refs/heads/WICKET-4008-property-expression-parser cd96fb1c5 -> 2f302dbfd WICKET-4008 property expression parser implementation Add some weird test cases Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/2f302dbf Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/2f302dbf Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/2f302dbf Branch: refs/heads/WICKET-4008-property-expression-parser Commit: 2f302dbfdc7bd60afca76bccbfac81ccbcbf6af1 Parents: cd96fb1 Author: Martin Tzvetanov GrigorovAuthored: Tue Sep 20 22:33:13 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Tue Sep 20 22:33:13 2016 +0200 -- .../util/lang/PropertyExpressionParser.java | 6 +++--- .../util/lang/PropertyExpressionParserTest.java | 22 +--- 2 files changed, 22 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/2f302dbf/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java index 4588218..08fd061 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyExpressionParser.java @@ -98,7 +98,7 @@ public class PropertyExpressionParser case END_OF_EXPRESSION : return expression; default : - throw new ParserException("expecting a new expression but got: " + currentToken); + throw new ParserException("expecting a new expression but got: '" + currentToken + "'"); } } @@ -164,9 +164,9 @@ public class PropertyExpressionParser { if (lookaheadToken != ')') { - throw new ParserException("expecting a method sign but got: " + currentToken); + throw new ParserException("expecting a method sign but got: '" + currentToken + "'"); } advance();// skips right bracket return true; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/wicket/blob/2f302dbf/wicket-core/src/test/java/org/apache/wicket/core/util/lang/PropertyExpressionParserTest.java -- diff --git a/wicket-core/src/test/java/org/apache/wicket/core/util/lang/PropertyExpressionParserTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/PropertyExpressionParserTest.java index 96d3739..d6c2803 100644 --- a/wicket-core/src/test/java/org/apache/wicket/core/util/lang/PropertyExpressionParserTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/PropertyExpressionParserTest.java @@ -3,11 +3,9 @@ package org.apache.wicket.core.util.lang; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; -import org.apache.wicket.core.util.lang.ParserException; -import org.apache.wicket.core.util.lang.PropertyExpression; -import org.apache.wicket.core.util.lang.PropertyExpressionParser; import org.apache.wicket.core.util.lang.PropertyExpression.Property; import org.hamcrest.CoreMatchers; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -35,6 +33,24 @@ public class PropertyExpressionParserTest assertThat(parse.next, CoreMatchers.nullValue()); } + // TODO mgrigorov: @pedrosans: I'd expect the error message to complain about the space, not 'r' + @Test + public void shouldFailParsePropertyExpressionsWithSpace() + { + expectedException.expect(ParserException.class); + expectedException + .expectMessage("expecting a new expression but got: ' '"); + parser.parse("per son"); + } + + // TODO mgrigorov: @pedrosans: IMO this should pass. Or otherwise should complain about the space, not '(' + @Test + public void shouldParsePropertyExpressionsWithSpaceInMethod() + { + final PropertyExpression parse = parser.parse("person( )"); + assertThat(parse.property, is(new Property("person", null, true))); + } + @Test public void shouldParseIndexedPropertyExpressions() {
[jira] [Commented] (WICKET-6245) Open up CsrfPreventionRequestCycleListener for extension
[ https://issues.apache.org/jira/browse/WICKET-6245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507661#comment-15507661 ] ASF subversion and git services commented on WICKET-6245: - Commit 6cd10f970d49ee1cd275c5038aa3c58c9738efaf in wicket's branch refs/heads/wicket-7.x from [~mgrigorov] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=6cd10f9 ] WICKET-6245 Open up CsrfPreventionRequestCycleListener for extension Wrap a debug logiing in LOG.isDebugEnabled() > Open up CsrfPreventionRequestCycleListener for extension > > > Key: WICKET-6245 > URL: https://issues.apache.org/jira/browse/WICKET-6245 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.20.0, 7.0.0, 6.21.0, 7.1.0, 7.2.0, 7.3.0, 8.0.0-M1, > 6.22.0, 6.23.0, 7.4.0, 6.24.0 >Reporter: Martijn Dashorst >Assignee: Martijn Dashorst >Priority: Minor > Fix For: 8.0.0-M2, 6.25.0, 7.5.0 > > > The design of the CsrfPreventionRequestCycleListener is such that it is open > for extension, but fails to provide the right hooks for implementors. We > should allow private methods to be called from event handlers, and allow > overriding of several checkpoints in the API. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6245) Open up CsrfPreventionRequestCycleListener for extension
[ https://issues.apache.org/jira/browse/WICKET-6245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507658#comment-15507658 ] ASF subversion and git services commented on WICKET-6245: - Commit 247619ab176c64acc3d07adcc45725e019e11a62 in wicket's branch refs/heads/master from [~mgrigorov] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=247619a ] WICKET-6245 Open up CsrfPreventionRequestCycleListener for extension Wrap a debug logiing in LOG.isDebugEnabled() > Open up CsrfPreventionRequestCycleListener for extension > > > Key: WICKET-6245 > URL: https://issues.apache.org/jira/browse/WICKET-6245 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.20.0, 7.0.0, 6.21.0, 7.1.0, 7.2.0, 7.3.0, 8.0.0-M1, > 6.22.0, 6.23.0, 7.4.0, 6.24.0 >Reporter: Martijn Dashorst >Assignee: Martijn Dashorst >Priority: Minor > Fix For: 8.0.0-M2, 6.25.0, 7.5.0 > > > The design of the CsrfPreventionRequestCycleListener is such that it is open > for extension, but fails to provide the right hooks for implementors. We > should allow private methods to be called from event handlers, and allow > overriding of several checkpoints in the API. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-6245 Open up CsrfPreventionRequestCycleListener for extension
Repository: wicket Updated Branches: refs/heads/master c819c6c4c -> 247619ab1 WICKET-6245 Open up CsrfPreventionRequestCycleListener for extension Wrap a debug logiing in LOG.isDebugEnabled() Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/247619ab Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/247619ab Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/247619ab Branch: refs/heads/master Commit: 247619ab176c64acc3d07adcc45725e019e11a62 Parents: c819c6c Author: Martin Tzvetanov GrigorovAuthored: Tue Sep 20 22:07:37 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Tue Sep 20 22:07:37 2016 +0200 -- .../protocol/http/CsrfPreventionRequestCycleListener.java| 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/247619ab/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java index ce03862..e6b61dc 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java @@ -27,7 +27,6 @@ import javax.servlet.http.HttpServletRequest; import org.apache.wicket.RestartResponseException; import org.apache.wicket.core.request.handler.IPageRequestHandler; import org.apache.wicket.core.request.handler.RenderPageRequestHandler; -import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.request.IRequestHandler; import org.apache.wicket.request.IRequestHandlerDelegate; import org.apache.wicket.request.component.IRequestablePage; @@ -358,8 +357,11 @@ public class CsrfPreventionRequestCycleListener extends AbstractRequestCycleList } else { - log.debug("Targeted page {} was opted out of the CSRF origin checks, allowed", - targetedPage.getClass().getName()); + if (log.isDebugEnabled()) + { + log.debug("Targeted page {} was opted out of the CSRF origin checks, allowed", + targetedPage.getClass().getName()); + } allowHandler(containerRequest, sourceUri, targetedPage); } }
wicket git commit: WICKET-6245 Open up CsrfPreventionRequestCycleListener for extension
Repository: wicket Updated Branches: refs/heads/wicket-7.x 2c570edf0 -> 6cd10f970 WICKET-6245 Open up CsrfPreventionRequestCycleListener for extension Wrap a debug logiing in LOG.isDebugEnabled() Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/6cd10f97 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/6cd10f97 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/6cd10f97 Branch: refs/heads/wicket-7.x Commit: 6cd10f970d49ee1cd275c5038aa3c58c9738efaf Parents: 2c570ed Author: Martin Tzvetanov GrigorovAuthored: Tue Sep 20 22:07:37 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Tue Sep 20 22:08:42 2016 +0200 -- .../protocol/http/CsrfPreventionRequestCycleListener.java| 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/6cd10f97/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java index 4025e7e..72fa4ee 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java @@ -27,7 +27,6 @@ import javax.servlet.http.HttpServletRequest; import org.apache.wicket.RestartResponseException; import org.apache.wicket.core.request.handler.IPageRequestHandler; import org.apache.wicket.core.request.handler.RenderPageRequestHandler; -import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.request.IRequestHandler; import org.apache.wicket.request.IRequestHandlerDelegate; import org.apache.wicket.request.component.IRequestablePage; @@ -358,8 +357,11 @@ public class CsrfPreventionRequestCycleListener extends AbstractRequestCycleList } else { - log.debug("Targeted page {} was opted out of the CSRF origin checks, allowed", - targetedPage.getClass().getName()); + if (log.isDebugEnabled()) + { + log.debug("Targeted page {} was opted out of the CSRF origin checks, allowed", + targetedPage.getClass().getName()); + } allowHandler(containerRequest, sourceUri, targetedPage); } }
[jira] [Commented] (WICKET-6240) Hook method to display more information on ExceptionErrorPage
[ https://issues.apache.org/jira/browse/WICKET-6240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507638#comment-15507638 ] ASF subversion and git services commented on WICKET-6240: - Commit 2c570edf028cf20ef573e45853692da1c00f4b5a in wicket's branch refs/heads/wicket-7.x from [~mgrigorov] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=2c570ed ] WICKET-6240 Hook method to display more information on ExceptionErrorPage > Hook method to display more information on ExceptionErrorPage > - > > Key: WICKET-6240 > URL: https://issues.apache.org/jira/browse/WICKET-6240 > Project: Wicket > Issue Type: Improvement >Reporter: Joachim Rohde >Assignee: Martin Grigorov >Priority: Minor > Fix For: 8.0.0-M2, 7.5.0 > > Attachments: CustomizedErrorPage.patch > > > Currently one of our customer is testing our application and every time an > exception occurs he just copies the complete content of the > ExceptionErrorPage into a ticket and forgets most of the times to include > further information that we requested, e.g. a timestamp. > At the moment I'm using a custom ExceptionMapper to render a custom error > page which enriches the existing ExceptionErrorPage with a few data from the > session and a timestamp. > It would be nice if this could be done more easily. > Attached you will find a trivial patch which does exactly that: add a > timestamp and provide a hook-method in the Application class which can be > overwritten to provide more information which should be displayed on the > error page. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Resolved] (WICKET-6240) Hook method to display more information on ExceptionErrorPage
[ https://issues.apache.org/jira/browse/WICKET-6240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Grigorov resolved WICKET-6240. - Resolution: Fixed Assignee: Martin Grigorov Fix Version/s: 7.5.0 8.0.0-M2 > Hook method to display more information on ExceptionErrorPage > - > > Key: WICKET-6240 > URL: https://issues.apache.org/jira/browse/WICKET-6240 > Project: Wicket > Issue Type: Improvement >Reporter: Joachim Rohde >Assignee: Martin Grigorov >Priority: Minor > Fix For: 8.0.0-M2, 7.5.0 > > Attachments: CustomizedErrorPage.patch > > > Currently one of our customer is testing our application and every time an > exception occurs he just copies the complete content of the > ExceptionErrorPage into a ticket and forgets most of the times to include > further information that we requested, e.g. a timestamp. > At the moment I'm using a custom ExceptionMapper to render a custom error > page which enriches the existing ExceptionErrorPage with a few data from the > session and a timestamp. > It would be nice if this could be done more easily. > Attached you will find a trivial patch which does exactly that: add a > timestamp and provide a hook-method in the Application class which can be > overwritten to provide more information which should be displayed on the > error page. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-6240 Hook method to display more information on ExceptionErrorPage
Repository: wicket Updated Branches: refs/heads/wicket-7.x 87fa74899 -> 2c570edf0 WICKET-6240 Hook method to display more information on ExceptionErrorPage Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/2c570edf Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/2c570edf Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/2c570edf Branch: refs/heads/wicket-7.x Commit: 2c570edf028cf20ef573e45853692da1c00f4b5a Parents: 87fa748 Author: Martin Tzvetanov GrigorovAuthored: Tue Sep 20 21:59:23 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Tue Sep 20 22:01:18 2016 +0200 -- .../main/java/org/apache/wicket/Application.java | 7 ++- .../request/cycle/IRequestCycleListener.java | 16 ++-- .../wicket/settings/ApplicationSettings.java | 19 --- .../apache/wicket/request/IExceptionMapper.java | 3 +++ 4 files changed, 31 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/2c570edf/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 0df8caf..22a9971 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -850,7 +850,12 @@ public abstract class Application implements UnboundListener, IEventSink } /** -* @return the exception mapper provider +* Returns a supplier of {@link IExceptionMapper} that will be used to +* handle exceptions which were not handled by any +* {@link IRequestCycleListener#onException(RequestCycle, Exception) request cycle listener}. +* +* @return the exception mapper supplier +* @see IRequestCycleListener#onException(RequestCycle, Exception) */ public IProvider getExceptionMapperProvider() { http://git-wip-us.apache.org/repos/asf/wicket/blob/2c570edf/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java b/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java index a755e67..74574ec 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java @@ -144,15 +144,19 @@ public interface IRequestCycleListener * * Note that in the event of an exception, {@link #onEndRequest(RequestCycle)} will still be called after * these listeners have {@link #onException(RequestCycle, Exception)} called -* -* @param cycle -* -* @return request handler that will be executed or {@code null} if none. If a request handler -* is returned, it will override any configured exception mapper -* +* +* Important: Custom implementations are recommended to not try to +* handle exceptions implementing {@link org.apache.wicket.IWicketInternalException} interface. +* Usually such kind of exceptions should be handled by the framework. +* +* +* @param cycle The current {@link RequestCycle request cycle} * @param ex *the exception that was passed in to *{@link RequestCycle#handleException(Exception)} +* @return request handler that will be executed or {@code null} if none. If a request handler +* is returned, it will override any configured +* {@link Application#getExceptionMapperProvider() exception mapper}. */ IRequestHandler onException(RequestCycle cycle, Exception ex); http://git-wip-us.apache.org/repos/asf/wicket/blob/2c570edf/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java index 52be4f6..3dc699d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java +++ b/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java @@ -23,6 +23,7 @@ import org.apache.wicket.application.DefaultClassResolver; import
wicket git commit: WICKET-6240 Hook method to display more information on ExceptionErrorPage
Repository: wicket Updated Branches: refs/heads/master 8538df05c -> c819c6c4c WICKET-6240 Hook method to display more information on ExceptionErrorPage Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/c819c6c4 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/c819c6c4 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/c819c6c4 Branch: refs/heads/master Commit: c819c6c4cda01f805e078e2d32482cd234cb53a5 Parents: 8538df0 Author: Martin Tzvetanov GrigorovAuthored: Tue Sep 20 21:59:23 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Tue Sep 20 21:59:23 2016 +0200 -- .../main/java/org/apache/wicket/Application.java | 7 ++- .../request/cycle/IRequestCycleListener.java | 16 ++-- .../wicket/settings/ApplicationSettings.java | 19 --- .../apache/wicket/request/IExceptionMapper.java | 3 +++ 4 files changed, 31 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/c819c6c4/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 5b232d8..95c05af 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -677,7 +677,12 @@ public abstract class Application implements UnboundListener, IEventSink } /** -* @return the exception mapper provider +* Returns a supplier of {@link IExceptionMapper} that will be used to +* handle exceptions which were not handled by any +* {@link IRequestCycleListener#onException(RequestCycle, Exception) request cycle listener}. +* +* @return the exception mapper supplier +* @see IRequestCycleListener#onException(RequestCycle, Exception) */ public Supplier getExceptionMapperProvider() { http://git-wip-us.apache.org/repos/asf/wicket/blob/c819c6c4/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java b/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java index a755e67..74574ec 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java @@ -144,15 +144,19 @@ public interface IRequestCycleListener * * Note that in the event of an exception, {@link #onEndRequest(RequestCycle)} will still be called after * these listeners have {@link #onException(RequestCycle, Exception)} called -* -* @param cycle -* -* @return request handler that will be executed or {@code null} if none. If a request handler -* is returned, it will override any configured exception mapper -* +* +* Important: Custom implementations are recommended to not try to +* handle exceptions implementing {@link org.apache.wicket.IWicketInternalException} interface. +* Usually such kind of exceptions should be handled by the framework. +* +* +* @param cycle The current {@link RequestCycle request cycle} * @param ex *the exception that was passed in to *{@link RequestCycle#handleException(Exception)} +* @return request handler that will be executed or {@code null} if none. If a request handler +* is returned, it will override any configured +* {@link Application#getExceptionMapperProvider() exception mapper}. */ IRequestHandler onException(RequestCycle cycle, Exception ex); http://git-wip-us.apache.org/repos/asf/wicket/blob/c819c6c4/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java index 52be4f6..3dc699d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java +++ b/wicket-core/src/main/java/org/apache/wicket/settings/ApplicationSettings.java @@ -23,6 +23,7 @@ import org.apache.wicket.application.DefaultClassResolver; import org.apache.wicket.application.IClassResolver;
[jira] [Commented] (WICKET-6240) Hook method to display more information on ExceptionErrorPage
[ https://issues.apache.org/jira/browse/WICKET-6240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507636#comment-15507636 ] ASF subversion and git services commented on WICKET-6240: - Commit c819c6c4cda01f805e078e2d32482cd234cb53a5 in wicket's branch refs/heads/master from [~mgrigorov] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=c819c6c ] WICKET-6240 Hook method to display more information on ExceptionErrorPage > Hook method to display more information on ExceptionErrorPage > - > > Key: WICKET-6240 > URL: https://issues.apache.org/jira/browse/WICKET-6240 > Project: Wicket > Issue Type: Improvement >Reporter: Joachim Rohde >Priority: Minor > Attachments: CustomizedErrorPage.patch > > > Currently one of our customer is testing our application and every time an > exception occurs he just copies the complete content of the > ExceptionErrorPage into a ticket and forgets most of the times to include > further information that we requested, e.g. a timestamp. > At the moment I'm using a custom ExceptionMapper to render a custom error > page which enriches the existing ExceptionErrorPage with a few data from the > session and a timestamp. > It would be nice if this could be done more easily. > Attached you will find a trivial patch which does exactly that: add a > timestamp and provide a hook-method in the Application class which can be > overwritten to provide more information which should be displayed on the > error page. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5836) Update the version of clirr-maven-plugin (current 2.6.1)
[ https://issues.apache.org/jira/browse/WICKET-5836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507580#comment-15507580 ] Tobias Soloschenko commented on WICKET-5836: Yay! Great! Thanks a lot Martin. > Update the version of clirr-maven-plugin (current 2.6.1) > > > Key: WICKET-5836 > URL: https://issues.apache.org/jira/browse/WICKET-5836 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.20.0, 7.0.0-M6, 8.0.0-M1 >Reporter: Tobias Soloschenko >Assignee: Martin Grigorov >Priority: Minor > Fix For: 8.0.0-M2 > > > This ticket is targeting Wicket 6.x, 7.x, 8.x compiled with JDK 8, because > the current version of the clirr plugin 2.6.1 isn't compatible with Java 8. > At the moment there is no version higher then 2.6.1 so we have to wait until > release. > More information can be found here: > http://mail-archives.apache.org/mod_mbox/commons-dev/201407.mbox/%3ccaczkxpzs2nxtvk5sejfyikvhp2817ey2b+7rak0w_nuyzha...@mail.gmail.com%3E > http://mail-archives.apache.org/mod_mbox/commons-dev/201407.mbox/%3c11f48c22-60d5-4a94-8ed2-42cccfefa...@email.android.com%3E > Here the correlating tickets: > https://issues.apache.org/jira/browse/BCEL-173 > https://issues.apache.org/jira/browse/BCEL-174 > https://issues.apache.org/jira/browse/BCEL-175 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Resolved] (WICKET-5836) Update the version of clirr-maven-plugin (current 2.6.1)
[ https://issues.apache.org/jira/browse/WICKET-5836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Grigorov resolved WICKET-5836. - Resolution: Fixed Upgraded it to 2.8 which works on Java 8. > Update the version of clirr-maven-plugin (current 2.6.1) > > > Key: WICKET-5836 > URL: https://issues.apache.org/jira/browse/WICKET-5836 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.20.0, 7.0.0-M6, 8.0.0-M1 >Reporter: Tobias Soloschenko >Assignee: Martin Grigorov >Priority: Minor > Fix For: 8.0.0-M2 > > > This ticket is targeting Wicket 6.x, 7.x, 8.x compiled with JDK 8, because > the current version of the clirr plugin 2.6.1 isn't compatible with Java 8. > At the moment there is no version higher then 2.6.1 so we have to wait until > release. > More information can be found here: > http://mail-archives.apache.org/mod_mbox/commons-dev/201407.mbox/%3ccaczkxpzs2nxtvk5sejfyikvhp2817ey2b+7rak0w_nuyzha...@mail.gmail.com%3E > http://mail-archives.apache.org/mod_mbox/commons-dev/201407.mbox/%3c11f48c22-60d5-4a94-8ed2-42cccfefa...@email.android.com%3E > Here the correlating tickets: > https://issues.apache.org/jira/browse/BCEL-173 > https://issues.apache.org/jira/browse/BCEL-174 > https://issues.apache.org/jira/browse/BCEL-175 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5836) Update the version of clirr-maven-plugin (current 2.6.1)
[ https://issues.apache.org/jira/browse/WICKET-5836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507573#comment-15507573 ] ASF subversion and git services commented on WICKET-5836: - Commit 8538df05c460d5e07da5585310cbe975bb4d838f in wicket's branch refs/heads/master from [~mgrigorov] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=8538df0 ] WICKET-5836 Update the version of clirr-maven-plugin > Update the version of clirr-maven-plugin (current 2.6.1) > > > Key: WICKET-5836 > URL: https://issues.apache.org/jira/browse/WICKET-5836 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.20.0, 7.0.0-M6, 8.0.0-M1 >Reporter: Tobias Soloschenko >Assignee: Martin Grigorov >Priority: Minor > Fix For: 8.0.0-M2 > > > This ticket is targeting Wicket 6.x, 7.x, 8.x compiled with JDK 8, because > the current version of the clirr plugin 2.6.1 isn't compatible with Java 8. > At the moment there is no version higher then 2.6.1 so we have to wait until > release. > More information can be found here: > http://mail-archives.apache.org/mod_mbox/commons-dev/201407.mbox/%3ccaczkxpzs2nxtvk5sejfyikvhp2817ey2b+7rak0w_nuyzha...@mail.gmail.com%3E > http://mail-archives.apache.org/mod_mbox/commons-dev/201407.mbox/%3c11f48c22-60d5-4a94-8ed2-42cccfefa...@email.android.com%3E > Here the correlating tickets: > https://issues.apache.org/jira/browse/BCEL-173 > https://issues.apache.org/jira/browse/BCEL-174 > https://issues.apache.org/jira/browse/BCEL-175 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-5836 Update the version of clirr-maven-plugin
Repository: wicket Updated Branches: refs/heads/master 5e1ced34e -> 8538df05c WICKET-5836 Update the version of clirr-maven-plugin Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/8538df05 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/8538df05 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/8538df05 Branch: refs/heads/master Commit: 8538df05c460d5e07da5585310cbe975bb4d838f Parents: 5e1ced3 Author: Martin Tzvetanov GrigorovAuthored: Tue Sep 20 21:38:57 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Tue Sep 20 21:38:57 2016 +0200 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/8538df05/pom.xml -- diff --git a/pom.xml b/pom.xml index d0bd499..9470419 100644 --- a/pom.xml +++ b/pom.xml @@ -987,7 +987,7 @@ org.codehaus.mojo clirr-maven-plugin - 2.7 + 2.8 7.0.0 true
[jira] [Assigned] (WICKET-5836) Update the version of clirr-maven-plugin (current 2.6.1)
[ https://issues.apache.org/jira/browse/WICKET-5836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Grigorov reassigned WICKET-5836: --- Assignee: Martin Grigorov > Update the version of clirr-maven-plugin (current 2.6.1) > > > Key: WICKET-5836 > URL: https://issues.apache.org/jira/browse/WICKET-5836 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.20.0, 7.0.0-M6, 8.0.0-M1 >Reporter: Tobias Soloschenko >Assignee: Martin Grigorov >Priority: Minor > Fix For: 8.0.0-M2 > > > This ticket is targeting Wicket 6.x, 7.x, 8.x compiled with JDK 8, because > the current version of the clirr plugin 2.6.1 isn't compatible with Java 8. > At the moment there is no version higher then 2.6.1 so we have to wait until > release. > More information can be found here: > http://mail-archives.apache.org/mod_mbox/commons-dev/201407.mbox/%3ccaczkxpzs2nxtvk5sejfyikvhp2817ey2b+7rak0w_nuyzha...@mail.gmail.com%3E > http://mail-archives.apache.org/mod_mbox/commons-dev/201407.mbox/%3c11f48c22-60d5-4a94-8ed2-42cccfefa...@email.android.com%3E > Here the correlating tickets: > https://issues.apache.org/jira/browse/BCEL-173 > https://issues.apache.org/jira/browse/BCEL-174 > https://issues.apache.org/jira/browse/BCEL-175 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-6246 backport change from WICKET-6162 replace original header container
Repository: wicket Updated Branches: refs/heads/wicket-6.x 89a2aac8c -> 664424a61 WICKET-6246 backport change from WICKET-6162 replace original header container Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/664424a6 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/664424a6 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/664424a6 Branch: refs/heads/wicket-6.x Commit: 664424a612c337ec200b276e0ec710fdd40b6ebc Parents: 89a2aac Author: Sven MeierAuthored: Tue Sep 20 14:58:30 2016 +0200 Committer: Sven Meier Committed: Tue Sep 20 14:58:40 2016 +0200 -- .../java/org/apache/wicket/ajax/AbstractAjaxResponse.java | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/664424a6/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxResponse.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxResponse.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxResponse.java index b3299fb..248178e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxResponse.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxResponse.java @@ -106,6 +106,8 @@ public abstract class AbstractAjaxResponse protected HtmlHeaderContainer header = null; + private Component originalHeaderContainer = null; + // whether a header contribution is being rendered private boolean headerRendering = false; @@ -125,6 +127,7 @@ public abstract class AbstractAjaxResponse public AbstractAjaxResponse(final Page page) { this.page = page; + this.originalHeaderContainer = page.get(HtmlHeaderSectionHandler.HEADER_ID); WebResponse response = (WebResponse) page.getResponse(); encodingBodyResponse = new AjaxResponse(response); @@ -165,9 +168,9 @@ public abstract class AbstractAjaxResponse writeFooter(response, encoding); } finally { - if (header != null) { + if (header != null && originalHeaderContainer!= null) { // restore a normal header - page.replace(new HtmlHeaderContainer(HtmlHeaderSectionHandler.HEADER_ID)); + page.replace(originalHeaderContainer); header = null; } }
[jira] [Commented] (WICKET-6162) Reload leads to unexpected RuntimeException 'Unable to find component with id'
[ https://issues.apache.org/jira/browse/WICKET-6162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15506453#comment-15506453 ] ASF subversion and git services commented on WICKET-6162: - Commit 664424a612c337ec200b276e0ec710fdd40b6ebc in wicket's branch refs/heads/wicket-6.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=664424a ] WICKET-6246 backport change from WICKET-6162 replace original header container > Reload leads to unexpected RuntimeException 'Unable to find component with id' > -- > > Key: WICKET-6162 > URL: https://issues.apache.org/jira/browse/WICKET-6162 > Project: Wicket > Issue Type: Bug >Affects Versions: 7.3.0 >Reporter: Fridolin Jackstadt >Assignee: Andrea Del Bene > Fix For: 8.0.0-M1, 7.4.0 > > Attachments: wicket-queuing.zip > > > The problem is related with component queuing in header. > Steps to reproduce: > 1. render page (/) > 2. do some ajax (/) > 3. reload (!) > {code:title=HomePage.java|borderStyle=solid} > queue(new Label("title", "test")); > add(new AjaxLink("link") { > @Override > public void onClick(AjaxRequestTarget ajaxRequestTarget) { > ajaxRequestTarget.add(this); > } > }.setOutputMarkupId(true)); > {code} > {code:title=HomePage.html|borderStyle=solid} > > test > > > > ajax > reload > > > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6246) WebSocket request while Ajax request leads to error regarding HtmlHeaderCotnainer
[ https://issues.apache.org/jira/browse/WICKET-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15506452#comment-15506452 ] ASF subversion and git services commented on WICKET-6246: - Commit 664424a612c337ec200b276e0ec710fdd40b6ebc in wicket's branch refs/heads/wicket-6.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=664424a ] WICKET-6246 backport change from WICKET-6162 replace original header container > WebSocket request while Ajax request leads to error regarding > HtmlHeaderCotnainer > - > > Key: WICKET-6246 > URL: https://issues.apache.org/jira/browse/WICKET-6246 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.24.0 >Reporter: Thomas Chrenko >Assignee: Sven Meier > Labels: header, header-contribution > Fix For: 6.25.0 > > Attachments: quickstart.zip > > > There is a problem with header contribution with leads to a "Cannot replace a > component which has not been added: id='_header_'" error. > Short: > - Add at least two components to an AjaxRequestTarget > - The (at least) second component must initiate a WebSocket push update of > another component in onConfigure/onBeforeRender (maybe others) > - Exception at the end of ajax request (WebSocket request finishes without > problem) > Long: > AbstractAjaxResponse iterates all components to update in > writeComponents(Response, String). > For each component writeComponent(Response, String, Component, String) is > called in sub class XmlAjaxResponse which calls > writeHeaderContribution(Response, Component) of AbstractAjaxResponse. > This method creates the HtmlHeaderContainer and adds is to the page when > rendering of first component added to target starts. > Second component rendering (onConfigure/onBeforeRender) send a component > update via websocket push to the client. > The websocket request replaces the HtmlHeaderContainer added to the page and > at the end of the AbstractAjaxResponse.writeTo(Response, String) to header is > again replaced with a default one. > But this default header is removed on MarkupContainer.detachChildren() method. > Now the ajax request is "continued" and writeHeaderContribution is called for > the second component. > header is not null in writeHeaderContribution because it was already created > when processing the first component, so the header is not added to the page > again (remember it was replaced while websocket request). > Now at the end of writeTo method, wicket tries again to replace the header > with a default one (comment there says "restore normal header"). > This leads to an exception: Cannot replace a component which has not been > added: id='_header_' > A little notice: > The error would not happen, if second component would be processed before > first component, because then the HeaderContainerItem of the ajax request > isn't craeted before the websocket request is finished and so the header is > added to the page on creation. So the problem is the removal of the > HeaderContainerItem in detachChildren() after websocket request. > In Wicket 7.4 (the only one i tested, this works without problems) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Resolved] (WICKET-6246) WebSocket request while Ajax request leads to error regarding HtmlHeaderCotnainer
[ https://issues.apache.org/jira/browse/WICKET-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sven Meier resolved WICKET-6246. Resolution: Fixed Assignee: Sven Meier Fix Version/s: 6.25.0 Since WICKET-6162 the original header container is restored after a partial page update. This fixes this issue too, so I applied the change to 6.x too. > WebSocket request while Ajax request leads to error regarding > HtmlHeaderCotnainer > - > > Key: WICKET-6246 > URL: https://issues.apache.org/jira/browse/WICKET-6246 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.24.0 >Reporter: Thomas Chrenko >Assignee: Sven Meier > Labels: header, header-contribution > Fix For: 6.25.0 > > Attachments: quickstart.zip > > > There is a problem with header contribution with leads to a "Cannot replace a > component which has not been added: id='_header_'" error. > Short: > - Add at least two components to an AjaxRequestTarget > - The (at least) second component must initiate a WebSocket push update of > another component in onConfigure/onBeforeRender (maybe others) > - Exception at the end of ajax request (WebSocket request finishes without > problem) > Long: > AbstractAjaxResponse iterates all components to update in > writeComponents(Response, String). > For each component writeComponent(Response, String, Component, String) is > called in sub class XmlAjaxResponse which calls > writeHeaderContribution(Response, Component) of AbstractAjaxResponse. > This method creates the HtmlHeaderContainer and adds is to the page when > rendering of first component added to target starts. > Second component rendering (onConfigure/onBeforeRender) send a component > update via websocket push to the client. > The websocket request replaces the HtmlHeaderContainer added to the page and > at the end of the AbstractAjaxResponse.writeTo(Response, String) to header is > again replaced with a default one. > But this default header is removed on MarkupContainer.detachChildren() method. > Now the ajax request is "continued" and writeHeaderContribution is called for > the second component. > header is not null in writeHeaderContribution because it was already created > when processing the first component, so the header is not added to the page > again (remember it was replaced while websocket request). > Now at the end of writeTo method, wicket tries again to replace the header > with a default one (comment there says "restore normal header"). > This leads to an exception: Cannot replace a component which has not been > added: id='_header_' > A little notice: > The error would not happen, if second component would be processed before > first component, because then the HeaderContainerItem of the ajax request > isn't craeted before the websocket request is finished and so the header is > added to the page on creation. So the problem is the removal of the > HeaderContainerItem in detachChildren() after websocket request. > In Wicket 7.4 (the only one i tested, this works without problems) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6246) WebSocket request while Ajax request leads to error regarding HtmlHeaderCotnainer
[ https://issues.apache.org/jira/browse/WICKET-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15505737#comment-15505737 ] Sven Meier commented on WICKET-6246: Thanks! I'll try to find the difference to 7.x and why it works there. > WebSocket request while Ajax request leads to error regarding > HtmlHeaderCotnainer > - > > Key: WICKET-6246 > URL: https://issues.apache.org/jira/browse/WICKET-6246 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.24.0 >Reporter: Thomas Chrenko > Labels: header, header-contribution > Attachments: quickstart.zip > > > There is a problem with header contribution with leads to a "Cannot replace a > component which has not been added: id='_header_'" error. > Short: > - Add at least two components to an AjaxRequestTarget > - The (at least) second component must initiate a WebSocket push update of > another component in onConfigure/onBeforeRender (maybe others) > - Exception at the end of ajax request (WebSocket request finishes without > problem) > Long: > AbstractAjaxResponse iterates all components to update in > writeComponents(Response, String). > For each component writeComponent(Response, String, Component, String) is > called in sub class XmlAjaxResponse which calls > writeHeaderContribution(Response, Component) of AbstractAjaxResponse. > This method creates the HtmlHeaderContainer and adds is to the page when > rendering of first component added to target starts. > Second component rendering (onConfigure/onBeforeRender) send a component > update via websocket push to the client. > The websocket request replaces the HtmlHeaderContainer added to the page and > at the end of the AbstractAjaxResponse.writeTo(Response, String) to header is > again replaced with a default one. > But this default header is removed on MarkupContainer.detachChildren() method. > Now the ajax request is "continued" and writeHeaderContribution is called for > the second component. > header is not null in writeHeaderContribution because it was already created > when processing the first component, so the header is not added to the page > again (remember it was replaced while websocket request). > Now at the end of writeTo method, wicket tries again to replace the header > with a default one (comment there says "restore normal header"). > This leads to an exception: Cannot replace a component which has not been > added: id='_header_' > A little notice: > The error would not happen, if second component would be processed before > first component, because then the HeaderContainerItem of the ajax request > isn't craeted before the websocket request is finished and so the header is > added to the page on creation. So the problem is the removal of the > HeaderContainerItem in detachChildren() after websocket request. > In Wicket 7.4 (the only one i tested, this works without problems) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6246) WebSocket request while Ajax request leads to error regarding HtmlHeaderCotnainer
[ https://issues.apache.org/jira/browse/WICKET-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15505701#comment-15505701 ] Thomas Chrenko commented on WICKET-6246: The stackoverflow.com question where it all started: http://stackoverflow.com/questions/39511880/apache-wicket-push-websocket-component-update-while-ajax-request-rendering > WebSocket request while Ajax request leads to error regarding > HtmlHeaderCotnainer > - > > Key: WICKET-6246 > URL: https://issues.apache.org/jira/browse/WICKET-6246 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.24.0 >Reporter: Thomas Chrenko > Labels: header, header-contribution > Attachments: quickstart.zip > > > There is a problem with header contribution with leads to a "Cannot replace a > component which has not been added: id='_header_'" error. > Short: > - Add at least two components to an AjaxRequestTarget > - The (at least) second component must initiate a WebSocket push update of > another component in onConfigure/onBeforeRender (maybe others) > - Exception at the end of ajax request (WebSocket request finishes without > problem) > Long: > AbstractAjaxResponse iterates all components to update in > writeComponents(Response, String). > For each component writeComponent(Response, String, Component, String) is > called in sub class XmlAjaxResponse which calls > writeHeaderContribution(Response, Component) of AbstractAjaxResponse. > This method creates the HtmlHeaderContainer and adds is to the page when > rendering of first component added to target starts. > Second component rendering (onConfigure/onBeforeRender) send a component > update via websocket push to the client. > The websocket request replaces the HtmlHeaderContainer added to the page and > at the end of the AbstractAjaxResponse.writeTo(Response, String) to header is > again replaced with a default one. > But this default header is removed on MarkupContainer.detachChildren() method. > Now the ajax request is "continued" and writeHeaderContribution is called for > the second component. > header is not null in writeHeaderContribution because it was already created > when processing the first component, so the header is not added to the page > again (remember it was replaced while websocket request). > Now at the end of writeTo method, wicket tries again to replace the header > with a default one (comment there says "restore normal header"). > This leads to an exception: Cannot replace a component which has not been > added: id='_header_' > A little notice: > The error would not happen, if second component would be processed before > first component, because then the HeaderContainerItem of the ajax request > isn't craeted before the websocket request is finished and so the header is > added to the page on creation. So the problem is the removal of the > HeaderContainerItem in detachChildren() after websocket request. > In Wicket 7.4 (the only one i tested, this works without problems) -- This message was sent by Atlassian JIRA (v6.3.4#6332)