Grails
  1. Grails
  2. GRAILS-7740

GSP compilation error for valid code

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-M1
    • Fix Version/s: 2.0-M1
    • Component/s: View technologies
    • Labels:
      None

      Description

      A project with the google-visualization plugin installed won't build a war because some of the GSPs report false errors. This is a distilled version of the failing code from one:

      <g:each var="formatter" in="${visualizationData.formatters}">
         var formatter = new ${formatter.object}(${formatter.options});
      </g:each>
      

      The issue appears to be the parentheses - if you remove them it works. The top of the stack trace is

      org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Unclosed GSP expression
              at org.codehaus.groovy.grails.web.pages.GroovyPageScanner.checkValidExpressionState(GroovyPageScanner.java:272)
              at org.codehaus.groovy.grails.web.pages.GroovyPageScanner.nextToken(GroovyPageScanner.java:238)
              at org.codehaus.groovy.grails.web.pages.GroovyPageParser.page(GroovyPageParser.java:740)
              at org.codehaus.groovy.grails.web.pages.GroovyPageParser.generateGsp(GroovyPageParser.java:340)
              at org.codehaus.groovy.grails.web.pages.GroovyPageParser.generateGsp(GroovyPageParser.java:329)
      

        Issue Links

          Activity

          Hide
          Graeme Rocher added a comment -

          Probably related to Jeff's recent parser changes

          Show
          Graeme Rocher added a comment - Probably related to Jeff's recent parser changes
          Hide
          Jurgen Lust added a comment -

          I'm having trouble with this as well, especially in pages that have some jQuery code. This gsp page for example fails to compile, due to a Unclosed GSP expression on line 4:

          <script type="text/javascript">
          $(document).ready(function() {
              $('#${id}').fullCalendar({
                  theme: true<g:if test="${body}">,</g:if>
                  ${body}
              });
          });
          </script>
          
          <div id="${id}"></div>
          

          In Grails 1.3.x, this compiled fine.

          Show
          Jurgen Lust added a comment - I'm having trouble with this as well, especially in pages that have some jQuery code. This gsp page for example fails to compile, due to a Unclosed GSP expression on line 4: <script type="text/javascript"> $(document).ready(function() { $('#${id}').fullCalendar({ theme: true<g:if test="${body}">,</g:if> ${body} }); }); </script> <div id="${id}"></div> In Grails 1.3.x, this compiled fine.
          Hide
          Jeff Scott Brown added a comment -

          Thanks for the input Jurgen. Will get it straightened out right away.

          Show
          Jeff Scott Brown added a comment - Thanks for the input Jurgen. Will get it straightened out right away.

            People

            • Assignee:
              Jeff Scott Brown
              Reporter:
              Burt Beckwith
            • Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development