This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes What is the difference between these different comment styles? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "What is the difference between these different comment styles?" Watch "What is the difference between these different comment styles?" New topic
Author

What is the difference between these different comment styles?

Mary Chellapa
Ranch Hand

Joined: Jul 26, 2011
Posts: 93
What is the difference between <!-- and <%--

Mary
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mary Chellapa
Ranch Hand

Joined: Jul 26, 2011
Posts: 93
So can i say if i do <%-- its as good as deleting from the JSP page right.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Pretty much. It's there for the developer's benefit and will never be seen outside of the JSP page.
Vicky Vijay
Ranch Hand

Joined: Apr 23, 2008
Posts: 125
Mary,

Execute the below code for you reference,


Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Jan 10, 2002
Posts: 60785
    
  65

And, of course, scriptlets and Java code should never be used in a JSP written within the last 10 years.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the difference between these different comment styles?
 
Similar Threads
JRE vrs. JVM
Quick Question HttpSessionBinding vs HttpSessionAttribute Listeners
Difference
Run as AWT or SWT Application Eclipse Question
Portal7.0