Question: What is a Hidden Comment in JSP?

By: Guru Singh Printer Friendly Format    


Question: What is a Hidden Comment in JSP?

Answer:  A comment that documents the JSP page but is not sent to the client. The JSP engine ignores a hidden comment, and does not process any code within hidden comment tags. A hidden comment is not sent to the client, either in the displayed JSP page or the HTML page source. The hidden comment is useful when you want to hide or "comment out" part of your JSP page.

You can use any characters in the body of the comment except the closing --%> combination. If you need to use --%> in your comment, you can escape it by typing --%\>.
JSP Syntax
<%-- comment --%>

Examples
<%@ page language="java" %>
<html>
<head><title>A Hidden Comment </title></head>
<body>
<%-- This comment will not be visible to the colent in the page source --%>
</body>
</html>

 

 

 

 


Most Viewed Articles (in Interview )

What is difference between Java Bean and Enterprise Java Bean?

Question: What is an output comment in JSP?

Interview Question: Who makes the Struts?

Interview Question: Why do we need Struts?

Interview Question: How does Struts work?

Interview Question: Where can I get a copy of Struts?

Interview Question: Why aren't the Struts tags maintained as part of the Jakarta Taglibs project ?

Interview Question: What is EJB container?

Interview Question: What is Local client view in EJB?

Interview Question: Can I invoke Runtime.gc() in an EJB?

Interview Question: Why does EJB needs two interfaces(Home and Remote Interface)?

Interview Question: What is lazy loading?

Interview Question: What is re-entrant. Is session beans reentrant. Is entity beans reentrant?

Interview Question: What are the call back methods in Entity bean?

Interview Question: What is abstract schema?

Latest Articles (in Interview)

Comment on this tutorial