Meta tags:
author= Dinesh Rajput;
Headings (most frequently used words):
interface, httpsession, the, servlet, you, object, to, this, of, used, here, is, how, access, session, send, redirect, in, httpresponse, servlets, environment, setup, requestdispatcher, servletconfig, life, cycle, read, value, again, do, an, can, be, perform, two, tasks, commonly, methods, sessions, and, clusters, share, related, posts, about, author, dinesh, rajput,
Text of the page (most frequently used words):
spring (53), the (38), and (28), session (27), tutorial (25), interview (20), java (18), #servlet (13), web (10), boot (10), httpsession (10), this (9), microservices (8), design (8), core (8), with (8), object (8), dinesh (7), share (7), new (7), user (7), request (7), security (6), aop (6), jax (6), hibernate (6), interface (6), opens (6), window (6), example (6), public (6), returns (6), mvc (5), time (5), you (5), values (5), cloud (4), soap (4), rest (4), patterns (4), batch (4), architecture (4), use (4), related (4), about (4), stored (4), string (4), jdbc (3), struts (3), services (3), tutorials (3), hateoas (3), development (3), application (3), technologies (3), has (3), since (3), his (3), first (3), previous (3), when (3), servletconfig (3), servlets (3), between (3), server (3), are (3), not (3), one (3), associated (3), can (3), username (3), getsession (3), current (3), privacy (2), policy (2), who (2), training (2), service (2), linux (2), git (2), thymeleaf (2), mongo (2), ant (2), gradle (2), maven (2), build (2), tools (2), ajax (2), hadoop (2), mail (2), api (2), jstl (2), jsp (2), j2ee (2), computing (2), wsdl (2), questions (2), search (2), mobile (2), certification (2), monitoring (2), testing (2), let (2), react (2), learn (2), solve (2), common (2), problems (2), them (2), rajput (2), technical (2), author (2), pattern (2), different (2), latest (2), framework (2), company (2), developer (2), was (2), life (2), cycle (2), requestdispatcher (2), posts (2), pinterest (2), telegram (2), whatsapp (2), linkedin (2), facebook (2), next (2), using (2), database (2), access (2), servletcontext (2), genericservlet (2), difference (2), information (2), requests (2), unique (2), sent (2), which (2), attributes (2), read (2), have (2), servers (2), may (2), two (2), objects (2), void (2), last (2), milliseconds (2), midnight (2), january (2), 1970 (2), gmt (2), long (2), identifier (2), value (2), used (2), store (2), how (2), create (2), copyright, 2026, hands, performance, engineer, guide, continuous, full, stack, designing, applications, native, various, best, practices, chief, editor, website, dineshonjava, blog, dedicated, series, articles, been, enthusiast, 2008, pivotal, certified, professional, book, blogger, more, than, years, experience, aspects, expertise, lies, version, creating, apis, microservice, reactive, cassandra, mongodb, currently, working, technology, manager, leading, product, worked, tech, lead, bennett, coleman, ltd, paytm, passionate, loves, write, blogs, very, active, member, community, forums, comes, tops, list, environment, setup, httpresponse, send, redirect, file, uploading, sevlet, filter, advantages, over, cgi, what, httpservlet, overview, index, represents, contains, across, multiple, http, enters, your, site, for, given, identify, typically, cookie, parameter, sticky, where, always, same, throughout, whole, into, written, from, solution, problem, would, cluster, keep, mind, that, available, other, divided, evenly, sometimes, missing, sessions, clusters, invalidates, then, unbinds, any, bound, invalidate, client, number, getlastaccessedtime, created, measured, getcreationtime, containing, getid, commonly, methods, view, manipulate, such, creation, accessed, bind, perform, tasks, memory, container, getattribute, again, webservice, popular, setattribute, theusername, retrieve, later, see, protected, dopost, httpservletrequest, httpservletresponse, response, throws, servletexception, ioexception, there, true, boolean, does, creates, here, comments, december, 2013, home,
Text of the page (random words):
httpsession interface dinesh on java core java core java java 8 certification interview q a spring boot spring spring core spring aop spring mvc spring security microservices spring 4 spring 5 spring batch spring mobile spring hateoas hibernate hibernate search tutorials design patterns web services ws interview questions jax ws soap jax rs rest wsdl soap cloud computing struts 2 tutorial j2ee tutorial servlet tutorial jsp tutorial jstl tutorial jdbc tutorial jax b tutorial java mail api hadoop tutorial ajax tutorial build tools maven gradle ant mongo db thymeleaf git linux interview q a spring interview aop interview mvc interview spring boot interview microservices interview spring security interview web service interview training who i am privacy policy home servlet httpsession interface december 28 2013 no comments httpsession interface the httpsession object represents a user session a user session contains information about the user across multiple http requests when a user enters your site for the first time the user is given a unique id to identify his session by this id is typically stored in a cookie or in a request parameter here is how you access the session object public httpsession getsession returns the current session associated with this request or if the request does not have a session creates one public httpsession getsession boolean create returns the current httpsession associated with this request or if there is no current session and create is true returns a new session protected void dopost httpservletrequest request httpservletresponse response throws servletexception ioexception httpsession session request getsession you can store values in the session object and retrieve them later first let s see how you can store values in the session object session setattribute username theusername popular tutorials spring tutorial spring mvc web tutorial spring boot tutorial spring security tutorial spring aop tutorial spring jdbc tutorial spring hateoas microservices with spring boot rest webservice core java hibernate tutorial spring batch to read the value again you do this string username string session getattribute username values stored in the session object are stored in the memory of the servlet container an object of httpsession can be used to perform two tasks bind objects view and manipulate information about a session such as the session identifier creation time and last accessed time commonly used methods of httpsession interface public string getid returns a string containing the unique identifier value public long getcreationtime returns the time when this session was created measured in milliseconds since midnight january 1 1970 gmt public long getlastaccessedtime returns the last time the client sent a request associated with this session as the number of milliseconds since midnight january 1 1970 gmt public void invalidate invalidates this session then unbinds any objects bound to it sessions and clusters if you have an architecture with 2 web servers in a cluster keep in mind that values stored in the session object of one server may not be available in the session object on the other server so if a user s requests are divided evenly between the two servers sometimes session values may be missing the solution to this problem would be one of do not use session attributes use a session database into which session attributes are written and from which it is read use sticky session where a user is always sent to the same server throughout the whole session previous index next servlet related posts java servlets overview servlet life cycle servlet example difference between servletconfig and servletcontext difference between genericservlet and httpservlet what is web application advantages of servlets over cgi genericservlet example requestdispatcher example servletconfig servletcontext servlet filter example database access example using sevlet file uploading example using servlet previous next share this share on facebook opens in new window facebook share on x opens in new window x share on linkedin opens in new window linkedin share on whatsapp opens in new window whatsapp share on telegram opens in new window telegram share on pinterest opens in new window pinterest servlet related posts send redirect in servlet httpresponse servlet servlets environment setup requestdispatcher interface servletconfig interface servlet life cycle about the author dinesh rajput dinesh rajput is the chief editor of a website dineshonjava a technical blog dedicated to the spring and java technologies it has a series of articles related to java technologies dinesh has been a spring enthusiast since 2008 and is a pivotal certified spring professional an author of a book spring 5 design pattern and a blogger he has more than 10 years of experience with different aspects of spring and java design and development his core expertise lies in the latest version of spring framework spring boot spring security creating rest apis microservice architecture reactive pattern spring aop design patterns struts hibernate web services spring batch cassandra mongodb and web application design and architecture he is currently working as a technology manager at a leading product and web development company he worked as a developer and tech lead at the bennett coleman co ltd and was the first developer in his previous company paytm dinesh is passionate about the latest java technologies and loves to write technical blogs related to it he is a very active member of the java and spring community on different forums when it comes to the spring framework and java dinesh tops the list learn various design patterns and best practices and use them to solve common design problems learn spring boot 2 0 and spring cloud application microservices architecture to solve common cloud native problems designing applications with spring boot 2 2 and react js let us full stack development with spring boot and react js hands on microservices monitoring and testing a performance engineer s guide to the continuous testing and monitoring of microservices dinesh on java copyright 2026 core java core java java 8 certification interview q a spring boot spring spring core spring aop spring mvc spring security microservices spring 4 spring 5 spring batch spring mobile spring hateoas hibernate hibernate search tutorials design patterns web services ws interview questions jax ws soap jax rs rest wsdl soap cloud computing struts 2 tutorial j2ee tutorial servlet tutorial jsp tutorial jstl tutorial jdbc tutorial jax b tutorial java mail api hadoop tutorial ajax tutorial build tools maven gradle ant mongo db thymeleaf git linux interview q a spring interview aop interview mvc interview spring boot interview microservices interview spring security interview web service interview training who i am privacy policy
|