This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the difference between these different comment styles?  RSS feed

 
Mary Chellapa
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between <!-- and <%--
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One is an HTML comment, the other is a JSP comment.

The former is just template text and ignored by the JSP engine just like any other template text and will be sent to the client verbatim. The latter is not considered template text and won't be sent to the client.
 
Mary Chellapa
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So can i say if i do <%-- its as good as deleting from the JSP page right.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pretty much. It's there for the developer's benefit and will never be seen outside of the JSP page.
 
Vicky Vijay
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mary,

Execute the below code for you reference,


 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guru,
Sorry, I have edited your post for removing the colored sub headline and for its larger font size.
Please use code tag while posting code next time.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, of course, scriptlets and Java code should never be used in a JSP written within the last 10 years.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!