After the session property is set, either the client jumps or the server-side jumps, as long as the property is set to get.
Here is a small example to verify:
(1) session_demo.jsp
1<%@ page contenttype= "text/html; Charset=utf-8 "Language=" Java "Import= "java.util.*" errorpage= ""%>2<!doctype html>345<meta charset= "Utf-8" >6<title>session Attribute Range </title>78 9<body>Ten<% OneSession.setattribute ("name", "Zhang San"); ASession.setattribute ("Birthday",NewDate ()); -%> -<a href= "session_demo2.jsp" > Get this property by Hyperlink </a> the</body> -(2) session_demo2.jsp
1 Import= "java.util.*" errorpage= ""%> 2 <!doctype html> 3 4 5 <meta charset= "Utf-8" > 6 <title>session attribute range </title> 7 8 9 <body>
Ten <%
One String Name= (String) session.getattribute ("name"); a Date birthday= (date) session.getattribute ("Birthday"); - %> </body>
Browser display:
You can see that the address bar has a jump, and the attribute value is also taken. However, if you access session_demo2.jsp directly in a new browser, you cannot get the session property of the setting. Every new browser connected to the server is a new session.
JSP_ Attribute Range _session