Share on Google+Share on Google+

JSPs : Comments

Advertisement
This tutorial contains description of comments which is one of JSP page element.

JSPs : Comments

This tutorial contains description of comments which is one of JSP page element.

Comments :

Comments help in understanding what is actually code doing. JSPs provides two types of comments for putting comment in your page. First type of comment is for output comment which is appeared in the output stream on the browser. It is written by using the <!-- and --> tags.

Syntax -

 <!-- comment text -->

Second type of comment is not delivered to the browser. It is written by using the <%-- and --%> tags.

Syntax -

  <%-- comment text --%>

Example :

<html>
<head>
<title>JSP Comment Example</title>
</head>
<body>
There is two types of comment.
<%--This is first type comment--%>
<p><%="Hello World"%></p>
<!--This is another type comment-->
<p><%="Hello Roseindia"%></p>
</body>
</html>

Output :

Advertisements

Advertisement

Posted on: December 3, 2012 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.