Session(Resin Example)
2008-01-05 08:36:47 来源:WEB开发网核心提示:<%@ page language=javascript %><% /* session.jsp * * Trivial example of session variables, just stores a counter * in the session variable. * * Sin
<%@ 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>
更多精彩
赞助商链接