<%@ 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>
闽公网安备 35060202000074号