Question: What is an output comment in JSP?

By: Guru Singh Printer Friendly Format    

Question: What is an output comment in JSP?

Answer:  A comment that is sent to the client in the viewable page source.The JSP engine handles an output comment as uninterpreted HTML text, returning the comment in the HTML output sent to the client. You can see the comment by viewing the page source from your Web browser.

JSP Syntax
<!-- comment [ <%= expression %> ] -->

Example 1

<!-- This is a commnet sent to client on
<%= (new java.util.Date()).toLocaleString() %>
-->

Displays in the page source:
<!-- This is a commnet sent to client on January 24, 2004 -->

 

 

 

 



Most Viewed Articles (in Interview )

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

Question: What is a Hidden Comment in JSP?

What is Collection API?

Question: What is an output comment in JSP?

What is difference between Java Bean and Enterprise Java Bean?

Can Entity Beans have no create() methods?

Interview Question: What is Struts?

Interview Question: How is the MVC design pattern used in Struts framework?

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

Interview Question: What is ActionServlet?

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 the difference between ejbCreate() and ejbPostCreate?

Interview Question: What is difference between EJB 1.1 and EJB 2.0?

Interview Question: Is Decorator an EJB design pattern?

Latest Articles (in Interview)

Comment on this tutorial