Hi everyone,

This letter is kind of similar to a previous one I sent, but I haven't
been able to make it work yet despite the replies I got... I'm trying to
develop pages that can keep session-scoped beans without using cookies.
I've understood that I need to use encodeURL, but I haven't been able to
make it work... Look at the code for two pages below. testBean is a very
simple bean that can store and return a string. If cookies are accepted
this code works perfect, but when I turn cookies off the output on the
second page is null. This seems to be because a new instance of the
testBean is created on page2, which it shouldn't be... Why is this???
Please help me in any way...

page1.jsp
<html>
<head>
<jsp:useBean id="test" class="test.testBean" scope="session" />
</head>
<body>
<%
test.setStreng("write it");
String encurl = response.encodeURL("http://xxx.xxx.xxx/test/page2.jsp");

out.println("<A HREF="+encurl+">Link</A>");
%>
</body>
</html>

page2.jsp
<html>
<head>
<jsp:useBean id="test" class="test.testBean" scope="session" />
</head>
<body>
<%
String it = test.getStreng();
out.println(it);
%>
</body>
</html>

/Tommy

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to