JSP内置对象-----page,pageContext

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JSP内置对象-PageContext</title>
</head>
<body>
    <h1>PageContext</h1>
    <hr>
    用户名是:<%=pageContext.getSession().getAttribute("userName") %><br>
    <%
    //跳转页面
    //    pageContext.forward("zhuce.jsp");
    //包含页面
    pageContext.include("neizhiPageContext2.jsp");
    %>

</body>
</html>
原文地址:https://www.cnblogs.com/1ming/p/9453058.html