How many ways to remove the session object in the container

Answer Posted / kishore

Session objects can be removed in three ways.
1> session.invalidate() - will remove all session objects
2> session.removeAtttribute(objName); - will remove the
specified object
3> session.setAtttribute(objName,null); - will remove the
specified object

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between get and post?

686


Can we override destroy method in servlet?

509


How do you configure a centralized error handler in servlets?

539


Is it possible to have a constructor inside the servlet?

554


What exactly are the functions of servlet?

606






What are the life cycle methods of a servlet?

597


What are the uses of servlet and what is servlet chaining?

563


What is the requirement of servlet config and servlet context implemented and how are they implemented?

547


Whats the advantages using servlets over using CGI?

590


What are the exceptions thrown by servlets? Why?

626


Which event is fired at the time of setting, getting or removing attribute from application scope?

621


Why do we have servlet wrapper classes?

582


What is the difference between the include() and forward() methods?

573


Tell us something about servletcontext interface.

628


What is the dispatcher servlet?

518