Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are the methods in HttpSession and their use?

Answer Posted / kaushal

o getCreationTime()
Returns the time at which this session representation
was created, in milliseconds since midnight, January 1, 1970
UTC.
o getId()
Returns the identifier assigned to this session.
o getLastAccessedTime()
Returns the last time the client sent a request carrying
the identifier assigned to the session.
o getMaxInactiveInterval()
o getSessionContext()
Returns the context in which this session is bound.
Deprecated.
o getValue(String)
Returns the object bound to the given name in the
session's application layer data.
o getValueNames()
Returns an array of the names of all the application
layer data objects bound into the session.
o invalidate()
Causes this representation of the session to be
invalidated and removed from its context.
o isNew()
A session is considered to be "new" if it has been
created by the server, but the client has not yet
acknowledged joining the session.
o putValue(String, Object)
Binds the specified object into the session's
application layer data with the given name.
o removeValue(String)
Removes the object bound to the given name in the
session's application layer data.
o setMaxInactiveInterval(int)
Sets the maximum interval between requests that this
session will be kept by the host server.

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we get PrintWriter and ServletOutputStream both in a servlet?

1149


What do you mean by cgi and what are its drawbacks?

987


What is pure servlet?

1212


Where do you define dispatcherservlet?

1052


Differentiate between get and post?

1163


Explain their methods? Tell me their parameter names also have you used threads in servlet?

1043


What is the life-cycle of servlets?

1139


What is servlet in tomcat?

1059


What is Request Dispatcher?

1439


What is the functionality of actionservlet and requestprocessor?

1090


How can we invoke another servlet in a different application?

1217


Which exception is thrown if the servlet is not initialized properly?

1028


Why don't we write a constructor in a servlet?

1057


Which java framework is most popular?

1144


Which event is fired at the time of project deployment and undeployment?

1322