81,092
社区成员
发帖
与我相关
我的任务
分享
<%@ 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>Insert title here</title>
</head>
<body>
SessionID:<%=session.getId() %>
<br>
<br>
IsNew:<%=session.isNew() %>
<br>
<br>
CreateTime:<%=session.getCreationTime() %>
<br>
<br>
LastAccessTime:<%=session.getLastAccessedTime() %>
<br>
<br>
MaxInactiveIntervalTime:<%=session.getMaxInactiveInterval() %>
<br>
<br>
<form action="hello.jsp" method=post>
username:<input type="text" name="username" value=<%=session.getAttribute("username") %>/>
<input type="submit" name="username" value="submit"/>
</form>
</body>
</html>
<%@ 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>Insert title here</title>
</head>
<body>
SessionID:<%=session.getId()%>
<br>
<br>
IsNew:<%=session.isNew()%>
<br>
<br>
CreateTime:<%=session.getCreationTime()%>
<br>
<br>
LastAccessTime:<%=session.getLastAccessedTime()%>
<br>
<br>
MaxInactiveIntervalTime:<%=session.getMaxInactiveInterval()%>
<br>
<br>
Hello:<%=request.getParameter("username") %>
<br>
<br>
<%session.setAttribute("username", request.getParameter("username"));
%>
<a href="login.jsp">重新登录</a>
</body>
</html>