cumanji 0 Report post Posted May 6, 2005 Hello, i want to get session info from a class that is not servlet (generally from in a bean). When we use servlets it is so easy to get session info by just using request.getSession() method. Is it possible to get this session info by importing a class? We can get info about application config by using ServletConfig class. Is there a class to like ServletConfig to get info about session/application? Share this post Link to post Share on other sites
Ola Daniel 0 Report post Posted June 15, 2006 Technically there is no way to get the web session from a normal java class (POJO).However if you wire your POJO into a web application using the J2EE MVCpattern or FrontController pattern.i.e JSP submits to servlet, servlet passes the HttpServletRequest Object to POJO or bean. You can access your web session, your servlet context throught the request obejct.I suggest you do some research on MVC and FrontController design patterns. Share this post Link to post Share on other sites
andresmtz 0 Report post Posted January 10, 2008 Technically there is no way to get the web session from a normal java class (POJO).However if you wire your POJO into a web application using the J2EE MVCpattern or FrontController pattern.i.e JSP submits to servlet, servlet passes the HttpServletRequest Object to POJO or bean. You can access your web session, your servlet context throught the request obejct.I suggest you do some research on MVC and FrontController design patterns. Does any one has an easy sample code to manage the session? I have done this only in php and I want to do the same with Java Server Pages.I want to know how to create the session, how to destroy the current session and clear all variables, how to get the session id and how to read the session variables.Thanks Share this post Link to post Share on other sites