<%--
Created by IntelliJ IDEA.
Date: 2022/4/13
Time: 20:06
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>JSP1</title>
</head>
<body>
<pre>
1.显示注释 客户端可以看到
<!-- HTML 注释 -->
2.隐示注释 客户端看不到
<%-- JSP注释 --%>
JAVA 注释
// /* */
</pre>
<%--尽量不用 耦合度高--%>
<%--JAVA 脚本段
生成代码在Servlet的service中 --%>
<%
String str="Hello JSP";
System.out.println(str);
System.out.println(num);//可以拿到%!中的变量
%>
<%--声明全局变量/方法/类等
生成代码在Servlet的类体中--%>
<%!
int num=5;
%>
<%--在页面输出表达式
生成代码在Servlet的service中--%>
<%=str
%>
</body>
</html>