That's great news - thanks! 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Greg Wilkins
> Sent: 29 May 2003 15:08
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; Jules Gosnell
> Subject: Re: [jetty-support] Re: [JBoss-user] Session scope 
> when forwarding to a separate web app
> 
> 
> 
> A patch for this issue has gone into Jetty CVS and will 
> propogate to JBoss shortly.
> 
> cheers
> 
> 
> Jules Gosnell wrote:
> > Alastair Rodgers wrote:
> > 
> > 
> >>Hello,
> >>
> >>I think I've come across a bug with HTTP session tracking in JBoss 
> >>3.0.6. I don't know if this is still a problem in 3.2.x as 
> I'm not yet 
> >>in a position to upgrade (though I plan to soon).
> >>
> >>I have two web apps deployed as two WARs. A client initiates a 
> >>stateful conversation with servlet 1 in app 1, which maintains the 
> >>state as an HTTP session. Eventually, after the client has 
> submitted 
> >>several requests, servlet 1 forwards the request to servlet 
> 2 in app 2 
> >>as
> >>follows: 
> >>
> >>getServletContext().getContext("/app2").getRequestDispatcher
> ("/servlet
> >>2"
> >>).forward(request, response);
> >>
> >>Servlet 2 then extracts some info from the request attributes, 
> >>performs some workflow, storing a result object "R" in the session, 
> >>then sends a response to the client. The client then continues a 
> >>stateful conversation with servlet 2.
> >>
> > 
> > So, in fact, servlet2 should be creating a new session, 
> since it would
> > not expect to be passed the session from the original 
> context. It should 
> > then attach this session via cookie or url rewriting to the 
> request, so 
> > that subsequent requests back to servlet2 find the correct 
> session. But 
> > it is actually getting the session from the original context (bug, 
> > methinks), storing it's state into this and then failing to 
> retrieve it 
> > on subsequent requests ?
> > 
> > I'm CC-ing this to Jetty support - we'll take a look at it. 
> Thanks for
> > the succinct report.
> > 
> > Jules
> > 
> > 
> >>My problem is that when servlet 2 first receives a request *directly
> > 
> >>from the client*, the session it gets from request.getSession() 
> >>appears
> > 
> >>to be a new session, so it doesn't contain the object "R" 
> stored after 
> >>the forward(request, response) call.
> >>
> >>Upon deeper investigation, I found that the address of the session 
> >>object in servlet 2 after the forward(request, response) 
> call is the 
> >>same as that in servlet 1 (it is the same object in 
> memory), whereas 
> >>the address of the session object in servlet 2 after the next POST 
> >>from the client is different (i.e. a new session object instance).
> >>
> >>This behaviour seems to be at odds with the servlet 2.3 
> spec (section 
> >>SRV.7.3 - Session Scope):
> >>
> >>"HttpSession objects must be scoped at the application (or servlet
> >>context) level.
> >>The underlying mechanism, such as the cookie used to establish the 
> >>session, can be the same for different contexts, but the object 
> >>referenced, including the attributes in
> >>that object, must never be shared between contexts by the container.
> >>To illustrate this requirement with an example: if a 
> servlet uses the
> >>RequestDispatcher to call a servlet in another web application, any
> >>sessions
> >>created for and visible to the callee servlet must be different from
> >>those visible to
> >>the calling servlet."
> >>
> >>So, is this a bug? If so, is it fixed in later releases?
> >>
> >>[NB: I've hacked a workaround, which involves duplicating 
> the state in 
> >>a SFSB, serialising the EJB handle and writing it to a hidden form 
> >>field in the HTML response, then populating the new session 
> from the 
> >>SFSB after the next POST - YUCK!]
> >>
> >>Thanks for any help, and thanks for a great product,
> >>
> >>Al.
> >>
> >>
> >>-------------------------------------------------------
> >>Enterprise Linux Forum Conference & Expo, June 4-6, 2003, 
> Santa Clara 
> >>The only event dedicated to issues related to Linux enterprise 
> >>solutions www.enterpriselinuxforum.com
> >>
> >>_______________________________________________
> >>JBoss-user mailing list
> >>[EMAIL PROTECTED]
> >>https://lists.sourceforge.net/lists/listinfo/jboss-user
> >> 
> >>
> > 
> > 
> > 
> > 
> > ------------------------ Yahoo! Groups Sponsor 
> > ---------------------~--> Rent DVDs from home. Over 14,500 titles. 
> > Free Shipping & No Late Fees. Try Netflix for FREE!
> > http://us.click.yahoo.com/BVVfoB/hP.FAA/uetFAA/CefplB/TM
> > 
> --------------------------------------------------------------
> -------~->
> > 
> > For the latest information about Jetty, please see 
> > http://jetty.mortbay.org
> > 
> >  
> > 
> > Your use of Yahoo! Groups is subject to 
> > http://docs.yahoo.com/info/terms/
> > 
> 
> 
> -- 
> Greg Wilkins<[EMAIL PROTECTED]>             Phone/fax: +44 7092063462
> Mort Bay Consulting Australia and UK.          http://www.mortbay.com
> 
> 
> 


-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to