Grails

GSP strange Error Messages, seems to go into groovy parsing mode without <% or ${ tags

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Not A Bug
  • Affects Version/s: 1.2 final
  • Fix Version/s: 1.2.1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Sles10

Description

i just downloaded the new version of grails 1.2 and upgraded it(i had 1.2 M1)
however my project wont work properly: the gsps are not working:

Following example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>s</title>

</head>
<body onload='document.getElementById("vOutputMenu").innerHTML="";'>
<div id="vOutputMenu">acbc</div>
</body>
</html>

However i get the Error:
[code]
Error 500: Could not parse script [home_umit_NetBeansProjects_ubis4_ubis4_grails_app_views_uebersichtViews_uebviews_gsp]: startup failed, home_umit_NetBeansProjects_ubis4_ubis4_grails_app_views_uebersichtViews_uebviews_gsp: 27: expecting '}', found 'vOutputMenu' @ line 27, column 157. 1 error
Servlet: grails
URI: /ubis4/grails/uebersichtViews/uebviews.dispatch
Exception Message: startup failed, home_umit_NetBeansProjects_ubis4_ubis4_grails_app_views_uebersichtViews_uebviews_gsp: 27: expecting '}', found 'vOutputMenu' @ line 27, column 157. 1 error
Caused by: Could not parse script [home_umit_NetBeansProjects_ubis4_ubis4_grails_app_views_uebersichtViews_uebviews_gsp]: startup failed, home_umit_NetBeansProjects_ubis4_ubis4_grails_app_views_uebersichtViews_uebviews_gsp: 27: expecting '}', found 'vOutputMenu' @ line 27, column 157. 1 error
Class: home_umit_NetBeansProjects_ubis4_ubis4_grails_app_views_uebersichtViews_uebviews_gsp
At Line: [9]
Code Snippet:
[/code]

and stack trace:
[code]
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Could not parse script [home_umit_NetBeansProjects_ubis4_ubis4_grails_app_views_uebersichtViews_uebviews_gsp]: startup failed, home_umit_NetBeansProjects_ubis4_ubis4_grails_app_views_uebersichtViews_uebviews_gsp: 27: expecting '}', found 'vOutputMenu' @ line 27, column 157.
1 error

at java.lang.Thread.run(Thread.java:619)

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, home_umit_NetBeansProjects_ubis4_ubis4_grails_app_views_uebersichtViews_uebviews_gsp: 27: expecting '}', found 'vOutputMenu' @ line 27, column 157.
1 error

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296)

at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:143)

at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:113)

at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:125)

at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:353)

at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:96)

at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:63)

at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:249)

at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:163)

at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:820)

at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:513)

at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:489)

at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:466)

... 1 more

[/code]

when i delete the body onload its working.

I hope you can help me ..

Activity

Hide
Graeme Rocher added a comment -

I would suggest using double quotes for your <body> tag attributes which is more valid HTML (and hence GSP)

Show
Graeme Rocher added a comment - I would suggest using double quotes for your <body> tag attributes which is more valid HTML (and hence GSP)
Hide
umit added a comment - - edited

ok
this kinda solved this problem
if i write:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>UBIS4 Übersicht Views</title>
<body onload="document.getElementById('vOutputMenu').innerHTML='';">
</body>
</html>
there is no error.

However can you please revert this to the previous behaviour because i wrote lots of code with this kind of style and when i upgrade grails nothing works.
It would be really nice if you can do this.

Show
umit added a comment - - edited ok this kinda solved this problem if i write: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>UBIS4 Übersicht Views</title> <body onload="document.getElementById('vOutputMenu').innerHTML='';"> </body> </html> there is no error. However can you please revert this to the previous behaviour because i wrote lots of code with this kind of style and when i upgrade grails nothing works. It would be really nice if you can do this.
Hide
Graeme Rocher added a comment -

It is part of the GSP preprocessing performance optimizations. You can revert to old behavior using 'grails.views.gsp.sitemesh.preprocess=false' in Config.groovy

Show
Graeme Rocher added a comment - It is part of the GSP preprocessing performance optimizations. You can revert to old behavior using 'grails.views.gsp.sitemesh.preprocess=false' in Config.groovy
Hide
umit added a comment -

thank you Mr. Rocher
thats a great advice because im not using sitemesh
ok i think i should close this issue or mark it as no bug but optimization.

Show
umit added a comment - thank you Mr. Rocher thats a great advice because im not using sitemesh ok i think i should close this issue or mark it as no bug but optimization.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: