<jsp:include page=”include2.jsp” flash=”true”>
<%@include file=”include2.jsp”%>
<jsp:forward page=”include2.jsp”>
<% response.sendRedirect(“include2.jsp”); %>
A选项是动态包含,动态包含的父页面和子页面是先翻译后合并,底层是
JspRuntimeLibrary.include(request, response, "/include/footer.jsp", out, false);
因为User是存在pageContext域中的数据,在分别翻译父页面和子页面时数据还不存在,所以不会显示
B选项是静态包含,相当于不include2.jsp页面内容拷贝到此处,因此可以输出User属性值
C和D选项分别使用了跳转和重定向
题中使用的是page域对象:pageContext,而C选项应该使用request域对象:HttpServletRequest,而D选项应该至少使用session域对象:HttpSession(如果处于同一会话中)。