findAttribute方法的执行顺序
findAttribute方法的执行顺序
1.jsp代码如下:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isErrorPage="true" isELIgnored="false"%>
<% request.setAttribute("name", "zs");%> <%--<% request.getRequestDispatcher("/public/top.jsp").include(request, response); %> <% request.getRequestDispatcher("/public/left.jsp").include(request, response); %> --%> username:
<%request.setAttribute("data", "aaaa");%> <% String data=(String)pageContext.getAttribute("data", pageContext.REQUEST_SCOPE); out.write(data);%>
<% String data1=(String)pageContext.findAttribute("data");%> String data=(String)pageContext.getAttribute("data",pageContext.REQUEST_SCOPE); <% out.write(data1);%>