9 Aug 2004 14:01
Re: FW: RE: session instance is changed during same request
Greg Wilkins <gregw <at> mortbay.com>
2004-08-09 12:01:31 GMT
2004-08-09 12:01:31 GMT
Sorry Alexey, been busy lately.. Looking at this now. cheers Alexey Yudichev wrote: > Greg, will there be any comment on that? Thanks. > > -----Original Message----- > From: Alexey Yudichev > Sent: Friday, July 23, 2004 9:22 AM > To: jetty-support <at> lists.sourceforge.net > Subject: [Jetty-support] RE: session instance is changed during same request > > > This is a single webapp with 4 filters installed. One of them (I18nFilter) uses request.getSession().setAttribute() to place a Map with i18ed string resources into session scope. Then, because user requested a non-existing page, Jetty forwards to 404 handler which is error404NotFound.jsp which in turn tries to find this map with resources by calling request.getSession().getAttribute() and finds nothing. In fact, as I discovered from exeperiments, this is already a different session instance with no attributes at all. > I do not get a dispatcher from ServletContext and I never interact with other contexts. So the dispatches you see are definitely not cross-context dispatches. > > -----Original Message----- > From: Greg Wilkins [mailto:gregw <at> mortbay.com] > Sent: Friday, July 23, 2004 3:15 AM > To: jetty-support <at> lists.sourceforge.net > Subject: Re: session instance is changed during same request > > > > Alexey, > > by Context I mean webapp. > > If you have two different webapps at > > /myapp1/* > /myapp2/* > > Then the session space is NOT shared between them. > If you dispatch from /myapp1 to /myapp2 then the session created in myapp1 is NOT visible > in /myapp2. You can configure /myapp2 to share the session ID - but it will not share the > session contents. > > So I can see two dispatches in your stack trace - what sort of dispatches are they? > Do you get a SerlvetContext and then get a dispatcher? > > regards > > > Alexey Yudichev wrote: > >>I am not sure what do you call a context here, but from my experience session instance is always the same for filter and a servlet during the same request unless some error (404 for example) is triggered. Is this the case when a new "Context" is created? >>Even if so, I don't understand the motivation. This is the same request, the same visitor that sent a single JSESSIONID cookie with valid sesison id and for some reason a new session's got created for him in the middle of his request processing. In this case error handlers are never able to access a correct session object right? >> >>-----Original Message----- >>From: Greg Wilkins [mailto:gregw <at> mortbay.com] >>Sent: Thursday, July 22, 2004 2:33 PM >>To: jetty-support <at> lists.sourceforge.net >>Subject: Re: session instance is changed during same request >> >> >> >>Alexey, >> >>are those dispatches cross context dispatches? >> >>Sessions are not shared between different contexts. If you want to communicate from a >>filter to a servlet, use request attributes. >> >>cheers >> >> >>Alexey Yudichev wrote: >> >> >>>I have Jetty 4.2.20 with jboss 3.2.3. Below is a request stack trace. I found that if a new session is created in this request, for example if a new browser instance is used, in error404NotFound.jsp request.getSession() returns a different session instance than was available in com.tw.servlet.filters.I18nFilter.doFilter and all session attributes that filter set are not found in JSP (hence the error). Is this an expected behaviour? >>> >>>javax.servlet.jsp.JspTagException: lang tag: no language specified, use 'define' tag >>> at com.tw.servlet.jsp.tag.lang.LangSelectTag.doEndTag(LangSelectTag.java:55) >>> at org.apache.jsp.error404NotFound_jsp._jspService(error404NotFound_jsp.java:147) >>> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) >>> at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) >>> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) >>> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) >>> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:356) >>> at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294) >>> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558) >>> at org.mortbay.http.HttpContext.handle(HttpContext.java:1723) >>> at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:514) >>> at org.mortbay.http.HttpResponse.sendError(HttpResponse.java:388) >>> at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:394) >>> at org.mortbay.jetty.servlet.ServletHandler.notFound(ServletHandler.java:837) >>> at org.mortbay.jetty.servlet.Default.handleGet(Default.java:262) >>> at org.mortbay.jetty.servlet.Default.service(Default.java:215) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) >>> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:356) >>> at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342) >>> at com.tw.eazybuild.filters.EazybuildFilter.doFilter(EazybuildFilter.java:116) >>> at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) >>> at com.tw.servlet.filters.I18nFilter.doFilter(I18nFilter.java:197) >>> at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) >>> at com.tw.servlet.filters.RequestInfoFIlter.doFilter(RequestInfoFIlter.java:107) >>> at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) >>> at com.tw.servlet.filters.ErrorHunterFilter.doFilter(ErrorHunterFilter.java:47) >>> at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) >>> at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286) >>> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558) >>> at org.mortbay.http.HttpContext.handle(HttpContext.java:1723) >>> at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:514) >>> at org.mortbay.http.HttpContext.handle(HttpContext.java:1673) >>> at org.mortbay.http.HttpServer.service(HttpServer.java:879) >>> at org.jboss.jetty.Jetty.service(Jetty.java:459) >>> at org.mortbay.http.HttpConnection.service(HttpConnection.java:783) >>> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:945) >>> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:800) >>> at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201) >>> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289) >>> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:454) >>> >>> >>>------------------------------------------------------- >>>This SF.Net email is sponsored by BEA Weblogic Workshop >>>FREE Java Enterprise J2EE developer tools! >>>Get your free copy of BEA WebLogic Workshop 8.1 today. >>>http://ads.osdn.com/?ad_idG21&alloc_id040&op=click >>>_______________________________________________ >>>Jetty-support mailing list >>>Jetty-support <at> lists.sourceforge.net >>>https://lists.sourceforge.net/lists/listinfo/jetty-support >>> >> >> >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by BEA Weblogic Workshop >>FREE Java Enterprise J2EE developer tools! >>Get your free copy of BEA WebLogic Workshop 8.1 today. >>http://ads.osdn.com/?ad_idG21&alloc_id040&op=click >>_______________________________________________ >>Jetty-support mailing list >>Jetty-support <at> lists.sourceforge.net >>https://lists.sourceforge.net/lists/listinfo/jetty-support >> > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_idG21&alloc_id040&op=ick > _______________________________________________ > Jetty-support mailing list > Jetty-support <at> lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jetty-support > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you noticed the changes on > Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, > one more big change to announce. We are now OSTG- Open Source Technology > Group. Come see the changes on the new OSTG site. www.ostg.com > _______________________________________________ > Jetty-support mailing list > Jetty-support <at> lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jetty-support > ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ Jetty-support mailing list Jetty-support <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jetty-support
RSS Feed