Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      <script>
      jQuery(function(){
      registerAutorefresh($

      {refresh}

      );
      });
      </script>

      Caused by: java.lang.RuntimeException: Error parsing property expression 'refresh});': Unable to parse input at character position 10.
      at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.parse(PropertyConduitSourceImpl.java:1441) ~[tapestry-core-5.3-alpha-13.jar:na]
      at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:1309) ~[tapestry-core-5.3-alpha-13.jar:na]
      at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSourceImpl.java:1274) ~[tapestry-core-5.3-alpha-13.jar:na]
      at $PropertyConduitSource_123d98bd5e9eaa20.create(Unknown Source) ~[na:na]
      at org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(PropBindingFactory.java:49) ~[tapestry-core-5.3-alpha-13.jar:na]
      at $BindingFactory_123d98bd5e9eaa21.newBinding(Unknown Source) ~[na:na]
      at $BindingFactory_123d98bd5e9eaa18.newBinding(Unknown Source) ~[na:na]
      at org.apache.tapestry5.internal.services.BindingSourceImpl.newBinding(BindingSourceImpl.java:78) ~[tapestry-core-5.3-alpha-13.jar:na]
      ... 94 common frames omitted
      Caused by: java.lang.RuntimeException: Unable to parse input at character position 10
      at org.apache.tapestry5.internal.antlr.BaseLexer.reportError(BaseLexer.java:50) ~[tapestry-core-5.3-alpha-13.jar:na]
      at org.antlr.runtime.Lexer.nextToken(Lexer.java:94) ~[antlr.jar:na]
      at org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:119) ~[antlr.jar:na]
      at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238) ~[antlr.jar:na]
      at org.apache.tapestry5.internal.antlr.PropertyExpressionParser.start(PropertyExpressionParser.java:98) ~[tapestry-core-5.3-alpha-13.jar:na]
      at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.parse(PropertyConduitSourceImpl.java:1437) ~[tapestry-core-5.3-alpha-13.jar:na]
      ... 101 common frames omitted
      Caused by: org.antlr.runtime.NoViableAltException: null
      at org.antlr.runtime.DFA.noViableAlt(DFA.java:158) ~[antlr.jar:na]
      at org.antlr.runtime.DFA.predict(DFA.java:116) ~[antlr.jar:na]
      at org.apache.tapestry5.internal.antlr.PropertyExpressionLexer.mTokens(PropertyExpressionLexer.java:1273) ~[tapestry-core-5.3-alpha-13.jar:na]
      at org.antlr.runtime.Lexer.nextToken(Lexer.java:84) ~[antlr.jar:na]
      ... 105 common frames omitted

        Issue Links

          Activity

          Hide
          Hudson added a comment -

          Integrated in tapestry-trunk-freestyle #497 (See https://builds.apache.org/job/tapestry-trunk-freestyle/497/)
          TAP5-1620: Tml parsing expression error
          TAP5-1448: Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml

          robertdzeigler : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163619
          Files :

          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc
          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ExpressionInJsFunction.tml
          • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
          Show
          Hudson added a comment - Integrated in tapestry-trunk-freestyle #497 (See https://builds.apache.org/job/tapestry-trunk-freestyle/497/ ) TAP5-1620 : Tml parsing expression error TAP5-1448 : Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml robertdzeigler : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1163619 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ExpressionInJsFunction.tml /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
          Hide
          Robert Zeigler added a comment -

          Fix for 1605 causes this issue.

          Show
          Robert Zeigler added a comment - Fix for 1605 causes this issue.
          Hide
          Robert Zeigler added a comment -

          So... if you use a reluctant search, then $'key': 'value' fails. If you use a greedy search, you can't use expansions in a js function because:

          function myfunc() {
          alert("$

          {value}");
          }

          Will match ${value}

          ");} and I don't see any way around that uses regular expressions. I could limit }, but that's just going to reproduce the reluctant behavior.

          I see 2 solutions:
          1) Rewrite the expansion parser to implement brace counting so that we actually end the expansion at the correct brace.
          2) Rework map support to use a character other than {} to delineate maps. We might be able to override the array syntax so that ['a','b','c'] creates an array, and ['a': 'b', 'c': 'd'] creates a map.

          I'm leaning toward option #1 at the moment. Even if I implement #2, it still means that someone using a literal } in an expression (contrived example: $

          {['a','}

          ']} is going to cause grief; of course, that example will cause grief for brace pairing, too...). I'd rather see smarter processing of templates to find the "right" match for the close of an expression.

          Show
          Robert Zeigler added a comment - So... if you use a reluctant search, then $ 'key': 'value' fails. If you use a greedy search, you can't use expansions in a js function because: function myfunc() { alert("$ {value}"); } Will match ${value} ");} and I don't see any way around that uses regular expressions. I could limit }, but that's just going to reproduce the reluctant behavior. I see 2 solutions: 1) Rewrite the expansion parser to implement brace counting so that we actually end the expansion at the correct brace. 2) Rework map support to use a character other than {} to delineate maps. We might be able to override the array syntax so that ['a','b','c'] creates an array, and ['a': 'b', 'c': 'd'] creates a map. I'm leaning toward option #1 at the moment. Even if I implement #2, it still means that someone using a literal } in an expression (contrived example: $ {['a','} ']} is going to cause grief; of course, that example will cause grief for brace pairing, too...). I'd rather see smarter processing of templates to find the "right" match for the close of an expression.
          Hide
          Robert Zeigler added a comment -

          Looks like my fix for maps in template expressions is a little too greedy.

          Show
          Robert Zeigler added a comment - Looks like my fix for maps in template expressions is a little too greedy.

            People

            • Assignee:
              Robert Zeigler
              Reporter:
              Denis Stepanov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development