ความคิดเห็น JSP (JSP comment) ทำเครื่องหมายข้อความหรือคำสั่งที่เครื่อง JSP ควรเพิกเฉย ความคิดเห็น JSP มีประโยชน์เมื่อคุณต้องการซ่อนหรือ "คอมเมนต์เอาท์" ส่วนหนึ่งของหน้า JSP
ไวยากรณ์ของความคิดเห็น JSP ดังนี้ -
<%-- This is JSP comment --%>
ตัวอย่างต่อไปนี้แสดงความคิดเห็น JSP -
<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>
โค้ดข้างต้นจะสร้างผลลัพธ์ดังนี้ -
A Test of Comments