• Post Reply Bookmark Topic Watch Topic
  • New Topic

Comments in JSP

 
C Vivek
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does JSP compiler treat comments JSP. Do the commented portions add on to the file size in the generated '.class' file??

Regards
Vivek C
[ March 12, 2008: Message edited by: C Vivek ]
 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not only in jsp, in every language comments are ignored by compiler.
so, that doesn't matters
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on which comments you're talking about.

HTML Comments or Javascript comments are treated as textual output by the JSP compiler and will survive all the way down to the browser.

Java comments (in scriptlets) will exist in the generated servlet sources but not in the compiled classes (typical of any compiled language, as Rajesh has pointed out).

JSP commments <%-- ... --%> are removed right up front and will not show up in the generated servlet source.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!