The HttpSession Context has been deprecated for a purpose, even though
it still
is supported by most servers inlcuding the reference implementation by
Sun.
What you need to do, is use the Monitor pattern to solve this
problem.This is discussed in detail
in the upcoming JSP book by Wrox press.
Identify the objetcts that need to be accessed by your second JSP, make
them implement the Session
Listener and when they are bound, store their reference in a Monitor.
JSP2 can then access that object not from the seesion , but by using the
handle stored in the Monitor
-Sameer
> 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 server
> o 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.
===========================================================================
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