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 )

Interview Question: What about JSTL and JavaServer Faces ?

Interview Question: Is there a particularly good IDE to use with Struts ?

Interview Question: Do ActionForms have to be true JavaBeans?

Interview Question: What is Remote client view?

Interview Question: What are the optional clauses in EJB QL?

Interview Question: What is the difference between EAR, JAR and WAR file?

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

Interview Question: How many EJB Objects are created for a Bean?

Interview Question: What is deployment descriptor?

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

Interview Question: What is Message Driven Bean?

Interview Question: What is local interface. How values will be passed?

Interview Question: What is abstract schema?

Interview Question: What is the difference between find and select methods in EJB?

Interview Question: Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?

Latest Articles (in Interview)

Comment on this tutorial