Details
Description
With the grails_core_2.0.x build #1229 (16.08.2011 05:23:30) the following error occurs upon running "grails prod war":
| Compiling 171 source files Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. |
| Compiling 46 source files |
| Compiling 46 source files. [from println in Config.groovy] Catalina Base: . [from println in Config.groovy] Environment: PRODUCTION |
| Compiling 46 source files..... DEBUG: setDebug: JavaMail version 1.4.3 [from println in Config.groovy] Catalina Base: . [from println in Config.groovy] Environment: PRODUCTION |
| Compiling 55 GSP files for package [myproj]. |
| Error GSP Compilation error in file /WEB-INF/grails-app/views/layouts/_piwik.gsp at line 18: Unclosed GSP expression |
The GSP in question:
<g:if env="production">
<g:set var="piwikSiteId" value="7" />
</g:if>
<g:elseif env="development">
<g:set var="piwikSiteId" value="8" />
</g:elseif>
<g:else>
<g:set var="piwikSiteId" value="0" />
</g:else>
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.example.org/" : "http://piwik.example.org/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", $
<%-- If this is a 404 page, provide additional information to Piwik --%>
<g:if test="${'static' == controllerName && 'notFound' == actionName}">
piwikTracker.setDocumentTitle('404/URL = '+String(document.location.pathname+document.location.search).replace(/\//g,"%2f") + '/From = ' + String(document.referrer).replace(/\//g,"%2f"));
</g:if>
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script>
<noscript><img src="http://piwik.example.org/piwik.php?idsite=${piwikSiteId}
" alt="" /></noscript>
Note that line #18 in the source is the comment, but even if it is removed the error persists at line 18. Maybe the line number is from the resulting compiled GSP ![]()
I hope this info is useful for further development.
Issue Links
- is related to
-
GRAILS-8199
GSP compilation fails for nested expression
-
-
GRAILS-8218
GString syntax error in GSP : Attribute value quote wasn't closed
-
-
GRAILS-7740
GSP compilation error for valid code
-
-
GRAILS-7741
HTML context influences brackets and braces check which leads to GSP compilation errors
-
-
GRAILS-7180
Double closure fails in GSP
-
Note that there is relevant test code in GroovyPagesTemplateEngineTests.testParsingNestedCurlyBraces() which is currently passing only because it uses notYetImplemented().