Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.4.1
-
Fix Version/s: None
-
Component/s: Scaffolding
-
Labels:None
Description
JSP spec indicates that scriptlet tags <% and %> can be escaped as <\% and %\> respectively. I have tried every combination of \<%, \<% and %>, %\>, \%\> etc that I can think of and all of them appear to produce complaints about unexpected "\" when I generate views:
hello <\% def h = "Mad World"; %\> world
produces:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,
Script1.groovy: 3: unexpected char: '\' @ line 3, column 13.
1 error
...
whereas
hello <% def h = "Mad World"; %> world
produces no errors but generates the following view (as expected):
hello world
-
Hide
- scriptlets-bug-report-20012012.zip
- 20/Jan/12 2:09 AM
- 23 kB
- Peter Ledbrook
-
- grails-app/.../ApplicationResources.groovy 0.1 kB
- grails-app/conf/BootStrap.groovy 0.1 kB
- grails-app/conf/BuildConfig.groovy 2 kB
- grails-app/conf/Config.groovy 4 kB
- grails-app/conf/DataSource.groovy 1 kB
- grails-app/conf/UrlMappings.groovy 0.2 kB
- grails-app/conf/spring/resources.groovy 0.0 kB
- grails-app/i18n/messages.properties 3 kB
- grails-app/.../messages_cs_CZ.properties 3 kB
- grails-app/i18n/messages_da.properties 3 kB
- grails-app/i18n/messages_de.properties 4 kB
- grails-app/i18n/messages_es.properties 3 kB
- grails-app/i18n/messages_fr.properties 2 kB
- grails-app/i18n/messages_it.properties 2 kB
- grails-app/i18n/messages_ja.properties 4 kB
- grails-app/i18n/messages_nl.properties 3 kB
- grails-app/.../messages_pt_BR.properties 3 kB
- grails-app/.../messages_pt_PT.properties 3 kB
- grails-app/i18n/messages_ru.properties 4 kB
- grails-app/i18n/messages_sv.properties 3 kB
- grails-app/i18n/messages_th.properties 6 kB
- grails-app/.../messages_zh_CN.properties 2 kB
- grails-app/views/.index.gsp.swp 12 kB
- grails-app/views/error.gsp 0.3 kB
- grails-app/views/index.gsp 3 kB
- grails-app/views/layouts/main.gsp 2 kB
- application.properties 0.1 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
The description was confusing because intended backslashes weren't visible (JIRA uses them for escaping).
<% and %\> no longer generate compilation errors, but the 'backslash' appears in the HTML output, which is not really desirable. See attached Grails 2 project: unpack, run, open home page in browser.
Contents of test case