JSP对象在SERVLET中
//jsp七大隐示对象
JspFactory _jspxFactory = null;
PageContext pageContext = null; //pageContext对象
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this; //page对象
1 pageContext对象
<%pageContext.getOut().print("1111111"); %>
JSP页面输出
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
项目根目录
pageContext.setAttribute("str", attr, pageContext.APPLICATION_SCOPE);
String attr1 = (String) pageContext.getAttribute("str", pageContext.APPLICATION_SCOPE);
2 page对象和request区别
一个request可以包含多个page页(include,forward以及filter).
引用
page对应jsp生成的servlet类的this引用