What are the methods in HttpSession and their use?
Answers were Sorted based on User's Feedback
getId()
getLastAccessedTime()
getCreationTime()
putValue()
getAttribute()
setAttribute()
Is This Answer Correct ? | 10 Yes | 2 No |
Answer / 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 |
Answer / amit tomar
getAttributesNames()
getId()
getLastAccessedTime()
getCreationTime()
putValue()
getAttribute()
setAttribute()
Is This Answer Correct ? | 3 Yes | 1 No |
What is life cycle of Servlet?
What is a server side include (ssi)
What are the classes and interfaces for servlets?
What do you mean by url pattern in servlet?
Which event is fired at the time of session creation and destroy?
what are the disadvantages of cookies?
What is the protocol used by Server & Client?
Explain the lifecycle of a servlet?
How do you get the ip address of the client in servlet?
Hi frnd can i any one kindly can post for me portlet,hibernate and spring example application and with flow explantion configuration using Jdeveloper.and related links ar tutorials kindly please send me .its urgent for me .thanks in advance...........else can any one send to kondaiah.goddeti@gmail.com
Which java framework is most popular?
How will you pass values from HTML page to the servlet?