JSP语法回顾:
JSP代码注释:
(1)// 单行注释
(2)/* */ 多行注释
(3) <%-- --%> 注释所有内容即不会被执行
(4)<!-- --> html注释
index.jsp
<%@ page language="java" contentType="text/html; charset=GBK"%> <html> <head> <title>jsp 例子</title> </head> <body> This is my JSP page. <br> <% //out.println("hello");%> <% /* out.println("hello multiple line1"); out.println("hello multiple line2"); out.println("hello multiple line3"); */ %> <%-- out.println("-- --");--%> <!-- html 注释--> </body> </html>
<html> <head> <title>jsp 例子</title> </head> <body> This is my JSP page. <br> <!-- html 注释--> </body> </html>