|
这是我按照OREILLY的<jsp设计>一书中的例子写的:
counter2.jsp:
<%@ page language="java" contentType="text/html" %>
<html>
<head>
<title>Counter Page 1<title>
</head>
<body>
<jsp:useBean
id="sessionCounter"
scope="session"
class="com.javaLee.jsp.beans.counter.CounterBean"
/>
<% String uri=request.getRequestURI(); %>
<h1>Counter Page 1</h1>
This page has been visited <b>
<%= sessionCounter.getNextValue(uri) %>
</b> times by the current user in the current session.
<p>
Click here to get to
<a href="<%= response.encodeURL("counter3.jsp") %>">
Counter Page 2</a>
</body>
</html>
书中说那个 response.encodeURL("counter3.jsp")
是URL复写,能够做到多个页面保持在一个会话期中,可是
我实验的结果,counter2.jsp和counter3.jsp还是各计各的数
这是怎么回事呀?
请兄弟们帮忙呀! |
|