JSPs : Comments


 

JSPs : Comments

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

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 :

Ads