The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > javax.servlet.jsp  [18 examples] > Java Server Pages Output  [4 examples]

e1057. Commenting a JSP Page

Two types of comments are allowed in a JSP page - - hidden and output comments. A hidden comment will not appear in the generated output whereas an output comment will appear in the generated output.

This example shows a hidden comment:

    <%-- my hidden comment --%>
A restriction for hidden comments is that the comment string cannot contain the character sequence --.

This example shows an output comment:

    <!-- my output comment -->
Similar to hidden comments, output comments cannot contain the character sequence --. Output comments can contain dynamic content:
    <!-- This page was generated on <%= new java.util.Date() %> -->
Output:
    <!-- This page was generated on Wed Jun 26 10:33:27 PDT 2002 -->

 Related Examples
e1058. Generating Dynamic Content on a JSP Page
e1059. Implementing Conditional Content on a JSP Page
e1060. Handling Unhandled Exceptions in a JSP Page

See also: Java Server Pages    Java Server Pages Headers    Java Server Pages Input   


© 2002 Addison-Wesley.