<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<%
//page
pageContext.setAttribute("name1","pageC");
//request
request.setAttribute("name2","req");
//session
session.setAttribute("name3","sess");
//application
application.setAttribute("name4","app");
%>
<%-- 服务端跳转--%>
<%-- <jsp:forward page="jsp3_1.jsp"></jsp:forward>--%>
<%-- 客户端跳转--%>
<a href="jsp3_1.jsp">click me</a>
</body>
</html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>jsp3_1</title>
</head>
<body>
<%
out.println("page "+pageContext.getAttribute("name1"));
out.println("req "+request.getAttribute("name2"));
out.println("sess "+session.getAttribute("name3"));
out.println("app "+application.getAttribute("name4"));
%>
</body>
</html>