JSP comment đánh dấu văn bản hoặc câu lệnh mà JSP container nên bỏ qua. JSP comment hữu ích khi bạn muốn ẩn hoặc "comment out" một phần của trang JSP.
Cú pháp của JSP comments:
<%-- This is JSP comment --%>
Ví dụ minh họa JSP Comments:
<html>
<head>
<title>A Comment Test</title>
</head>
<body>
<h2>A Test of Comments</h2>
<%-- This comment will not be visible in the page source --%>
</body>
</html>
Mã trên sẽ tạo ra kết quả sau:
A Test of Comments