Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In a grails gsp template, how can I use a server side comment without sitemesh throwing an error?

Tags:

When I use a standard jsp comment block in a gsp template

<%-- some server-side comment --%>     

, sitemesh throws an 'unexpected token' error. Is there another comment syntax I can use?

like image 796
gabe Avatar asked Jul 06 '11 18:07

gabe


People also ask

How do you comment on GSP?

Ctrl+Slash to comment. Result: Java/Groovy line comments are inserted outside the scriptlets, into HTML context. If some template text is also inside selection, then correct, GSP comments are inserted.

What is GSP in Grails?

Groovy Servers Pages (or GSP for short) is Grails' view technology. It is designed to be familiar for users of technologies such as ASP and JSP, but to be far more flexible and intuitive.


2 Answers

The following works for me

%{-- <div>hello</div> --}% 
like image 183
Dónal Avatar answered Jan 12 '23 15:01

Dónal


You are missing a '%' sign. Write it as :

<%-- some server-side comment --%> 
like image 20
MAlex Avatar answered Jan 12 '23 14:01

MAlex