6) session 隐式对象2025 年 3 月 17 日 | 阅读 1 分钟
session 隐式对象的示例index.html<html> <body> <form action="welcome.jsp"> <input type="text" name="uname"> <input type="submit" value="go"><br/> </form> </body> </html> welcome.jsp<html>
<body>
<%
String name=request.getParameter("uname");
out.print("Welcome "+name);
session.setAttribute("user",name);
<a href="second.jsp">second jsp page</a>
%>
</body>
</html>
second.jsp<html>
<body>
<%
String name=(String)session.getAttribute("user");
out.print("Hello "+name);
%>
</body>
</html>
输出 ![]() JSP 隐式对象中的其他主题request 隐式对象的示例 Response 隐式对象的示例 config 隐式对象的示例 application 隐式对象的示例 pageContext 隐式对象的示例 page 隐式对象的示例 exception 隐式对象的示例 |
我们请求您订阅我们的新闻通讯以获取最新更新。