How do I use comments within a JSP page?

You can use "JSP-style" comments to selectively block out code while debugging or simply to comment your scriptlets. JSP comments are not visible at the client.For example:<%-- the scriptlet is now commented out<%out.println("Hello World");%>--%>You can also use HTML-style comments anywhere within your JSP page. These comments are visible at the client. For example:<!-- (c) 2004 javagalaxy.com -->Of course, you can also use comments supported by your JSP scripting language within your scriptlets. For example, assuming Java is the scripting language, you can have:<%//some comment/**yet another comment**/%>

Showing Answers 1 - 1 of 1 Answers

suneela

  • Aug 13th, 2007
 

There are two types of comments in JSP
1.Output Comment:
   <!--  code   -->
If we use this comment ,the code will be seen in the viewable page source
2.Hidden Comment:
   <%--  code  --%>
If we use this comment ,the code will be hidden in viewable source code.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions