Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between these different comment styles?

 
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
Pie
Posts: 64843
86
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
Pie
Posts: 64843
86
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
Pie
Posts: 64843
86
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