John Hawkins wrote:
> [Apologies if this has been answered before - I had a look at the
> archives but couldn't find anything] Okay, This is the problem
> : o I have a JSP that creates some beans in session scope.o It then
> calls a piece of code which uses URL.OpenStream to open an inputstream
> to connect to another JSP on the same servero This second JSP
> needs to operate with/access objects in the session of the first
> JSP How do I do this ? The second JSP is always created with a new
> session ... I've tried encodeURL to add the session id to the called
> URL - this doesn't work, I'm guessing because the browser supports
> cookies and so encodeURL leaves the URL untouched. I've also toyed
> with the idea of having the second JSP get the HttpServletContext and
> manually request the session with the correct ID ... but this is a
> deprecated API and so I don't want to use it. Is there a
> non-deprecated way of doing this ? Any other ideas ? Many thanks,John.
PLEASE do not send HTML-encoded mail to mailing lists ... it is
difficult to read in many mail readers.
You are working way too hard. If the second JSP page is on the same
server, you can just use <jsp:include> to include it, and the second
page will have access to the same session.
Craig McClanahan
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html