服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > JAVA > 新手入门 > 基础入门 > 查看文档

session(resin example)


<%@ page language=javascript %><% 
/* session.jsp 

* trivial example of session variables, just stores a counter 
* in the session variable. 

* since the request object comes from the servlet api, resin 
* scripts can share session variables with java servlets. 
*/ 
var count = session.value.counter++; 

%> 

<html> 
<head><title>counter</title></head> 
<body bgcolor=#ffffff> 
<% 

if (session.isnew()) { 
%><h1>welcome to a new session.</h1><% 
} else if (session.value.name) { 
%><h1>welcome back: <%= session.value.name %> <%= count %> </h1><% 
} else { 
%><h1>welcome back: <%= count %> </h1><% 


%> 
<p/><a href="<%= response.encodeurl("session.jsp") %>">click</a> to enable 
session rewriting. 
</body> 
</html> 

扫描关注微信公众号