6

I know this is simple thing, but i was not aware.

I used println in gsp file and expected to print output in console. But this is showing on page.

<% 
for(int i =0; i < threads.size();i++) {
     println i
} 
%>

thanks.

sbglasius
  • 3,104
  • 20
  • 28
Srinath
  • 1,293
  • 3
  • 16
  • 25

1 Answers1

14

You can use

<%
   System.out.println i 
%>

But why use sniplets in a GSP page?

If you want console debug output from your GSP i suggest using this plugin: https://grails.org/plugin/debug

sbglasius
  • 3,104
  • 20
  • 28
  • thank you sbglasius. if removed <%%> tags in gsp , it is showing ERROR pages.GroovyPagesTemplateEngine - Compilation error compiling GSP – Srinath Apr 27 '10 at 12:37
  • Ah, I didn't want you to remove the <% %> - so please leave them :-) – sbglasius Apr 30 '10 at 11:42