日期:2014-05-17 浏览次数:20777 次
<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<html>
<head><title>www.mldn.cn</title></head>
<%
pageContext.setAttribute("name", "行者", PageContext.REQUEST_SCOPE) ;
pageContext.setAttribute("birthday", new Date(), PageContext.REQUEST_SCOPE) ;
%>
<jsp:forward page="page_scope_02.jsp"/>
</body>
</html>
<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<html>
<head><title>www.mldn.cn</title></head>
<body>
<%
String username = (String)pageContext.getAttribute("name");
Date userbirthday = (Date)pageContext.getAttribute("birthday");
%>
<h2>姓名:<%= username %></h2>
<h2>生日:<%= userbirthday %></h2>
</body>
</html>
<%
String username = (String)pageContext.getAttribute("name", PageContext.REQUEST_SCOPE);
Date userbirthday = (Date)pageContext.getAttribute("birthday", PageContext.REQUEST_SCOPE);