New sessions by each petition
Hi wickers !!! I'm battling with my application, and now I've noted something weird I've a custom WebSession class, in which I've coded a (horrible) log to check the creation of the new session: public class WebMySession extends WebSession { private static final Logger LOGGER = LoggerFactory.getLogger(WebMySession .class); public WebMySession(Request request) { super(request); LOGGER.debug(NEW SESSION!); } } Into my webapp class I do public class WebMyApplication extends WebApplication { [...] @Override public Session newSession(Request request, Response response) { return new WebMySession(request); } [...] } But when I enter the first time into the app, I see this logged: 12:12:26,133 DEBUG ServletWebRequest:197 - Calculating context relative path from: context path '', filterPrefix '', uri '/imagees/myxyz.jpg' 12:12:26,133 DEBUG WebMySession :24 - NEW SESSION! 12:12:26,133 DEBUG RequestCycle:215 - No suitable handler found for URL /imagees/myxyz.jpg, falling back to container to process this request 12:12:26,143 DEBUG ServletWebRequest:197 - Calculating context relative path from: context path '', filterPrefix '', uri '/imagees/myxyz2.jpg' 12:12:26,143 DEBUG WebMySession :24 - NEW SESSION! 12:12:26,143 DEBUG RequestCycle:215 - No suitable handler found for URL /imagees/myxyz2.jpg, falling back to container to process this request 12:12:26,163 DEBUG ServletWebRequest:197 - Calculating context relative path from: context path '', filterPrefix '', uri '/dynimg/id/1340795758750/name/mynewimage.jpg' 12:12:26,163 DEBUG WebIsdefeSession:24 - NEW SESSION! For every image, javascript and css that is into the /${webapp} and must be served directly from disk; and also from images created from a DynamicResource ¿ Is this ok or I've done something wrong ? ¿ Why there are so many sessions created ? I've tried with different browsers and the result is the same... Thanks in advance ! Oscar Besga Arcauz PS: Hope this email is not duplicated, I send one without subject and it doesn't appear to be on list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: New sessions by each petition
Hi, This is just a temporary session which is discarded at the end of the request. Until Session#bind() is called it is considered temporary and no HttpSession is being created. On Thu, Sep 20, 2012 at 2:43 PM, Oscar Besga Arcauz obe...@isdefe.es wrote: Hi wickers !!! I'm battling with my application, and now I've noted something weird I've a custom WebSession class, in which I've coded a (horrible) log to check the creation of the new session: public class WebMySession extends WebSession { private static final Logger LOGGER = LoggerFactory.getLogger(WebMySession .class); public WebMySession(Request request) { super(request); LOGGER.debug(NEW SESSION!); } } Into my webapp class I do public class WebMyApplication extends WebApplication { [...] @Override public Session newSession(Request request, Response response) { return new WebMySession(request); } [...] } But when I enter the first time into the app, I see this logged: 12:12:26,133 DEBUG ServletWebRequest:197 - Calculating context relative path from: context path '', filterPrefix '', uri '/imagees/myxyz.jpg' 12:12:26,133 DEBUG WebMySession :24 - NEW SESSION! 12:12:26,133 DEBUG RequestCycle:215 - No suitable handler found for URL /imagees/myxyz.jpg, falling back to container to process this request 12:12:26,143 DEBUG ServletWebRequest:197 - Calculating context relative path from: context path '', filterPrefix '', uri '/imagees/myxyz2.jpg' 12:12:26,143 DEBUG WebMySession :24 - NEW SESSION! 12:12:26,143 DEBUG RequestCycle:215 - No suitable handler found for URL /imagees/myxyz2.jpg, falling back to container to process this request 12:12:26,163 DEBUG ServletWebRequest:197 - Calculating context relative path from: context path '', filterPrefix '', uri '/dynimg/id/1340795758750/name/mynewimage.jpg' 12:12:26,163 DEBUG WebIsdefeSession:24 - NEW SESSION! For every image, javascript and css that is into the /${webapp} and must be served directly from disk; and also from images created from a DynamicResource ¿ Is this ok or I've done something wrong ? ¿ Why there are so many sessions created ? I've tried with different browsers and the result is the same... Thanks in advance ! Oscar Besga Arcauz PS: Hope this email is not duplicated, I send one without subject and it doesn't appear to be on list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: New sessions by each petition
Ok, i've used sessionbind and works as expected ! Also, I've checked that session is auto-binded when you use statefull components - my web tries to stay stateless most time, so this was the cause I saw so many 'new session' logs Thanks !! Oscar Besga Arcauz -Martin Grigorov mgrigo...@apache.org escribió: - Para: users@wicket.apache.org De: Martin Grigorov mgrigo...@apache.org Fecha: 20/09/2012 13:49 Asunto: Re: New sessions by each petition Hi, This is just a temporary session which is discarded at the end of the request. Until Session#bind() is called it is considered temporary and no HttpSession is being created. On Thu, Sep 20, 2012 at 2:43 PM, Oscar Besga Arcauz obe...@isdefe.es wrote: Hi wickers !!! I'm battling with my application, and now I've noted something weird I've a custom WebSession class, in which I've coded a (horrible) log to check the creation of the new session: public class WebMySession extends WebSession { private static final Logger LOGGER = LoggerFactory.getLogger(WebMySession .class); public WebMySession(Request request) { super(request); LOGGER.debug(NEW SESSION!); } } Into my webapp class I do public class WebMyApplication extends WebApplication { [...] @Override public Session newSession(Request request, Response response) { return new WebMySession(request); } [...] } But when I enter the first time into the app, I see this logged: 12:12:26,133 DEBUG ServletWebRequest:197 - Calculating context relative path from: context path '', filterPrefix '', uri '/imagees/myxyz.jpg' 12:12:26,133 DEBUG WebMySession :24 - NEW SESSION! 12:12:26,133 DEBUG RequestCycle:215 - No suitable handler found for URL /imagees/myxyz.jpg, falling back to container to process this request 12:12:26,143 DEBUG ServletWebRequest:197 - Calculating context relative path from: context path '', filterPrefix '', uri '/imagees/myxyz2.jpg' 12:12:26,143 DEBUG WebMySession :24 - NEW SESSION! 12:12:26,143 DEBUG RequestCycle:215 - No suitable handler found for URL /imagees/myxyz2.jpg, falling back to container to process this request 12:12:26,163 DEBUG ServletWebRequest:197 - Calculating context relative path from: context path '', filterPrefix '', uri '/dynimg/id/1340795758750/name/mynewimage.jpg' 12:12:26,163 DEBUG WebIsdefeSession:24 - NEW SESSION! For every image, javascript and css that is into the /${webapp} and must be served directly from disk; and also from images created from a DynamicResource ¿ Is this ok or I've done something wrong ? ¿ Why there are so many sessions created ? I've tried with different browsers and the result is the same... Thanks in advance ! Oscar Besga Arcauz PS: Hope this email is not duplicated, I send one without subject and it doesn't appear to be on list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org