answersLogoWhite

0


Best Answer

session.invalidate()

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which method invalidate session of a jsp page?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Basic Math

How do you set the session variables in jsp?

The session variables can be accessed in a jsp page from the request object. Note: Accessing session contents in JSP is not a good design practice


What is doGet method in servlet?

The doGet() method is the method inside a servlet that gets called every time a request from a jsp page is submitted. The control first reaches the doGet() method of the servlet and then the servlet decides what functionality to invoke based on the submit request. The get method called when the type of page submission is "GET" There is another way of submitting requests from a jsp page is "POST" and when that happens it calls the doPost() method inside the servlet.


What is JSP Implicit objects?

In any JSP Page, there are a bunch of implicit objects that are available for the programmer to use. It contains a variety of information that can be used to display stuff on the page. The following JSP Implicit Objects are available for a programmer: • request • response • out • session • config • application • page • pageContext


What are the built in objects in jsp?

The correct term is "JSP Implicit Objects" In any JSP Page, there are a bunch of implicit objects that are available for the programmer to use. It contains a variety of information that can be used to display stuff on the page. The following JSP Implicit Objects that are available for a programmer. • request • response • out • session • config • application • page • pageContext


How-to clear the session values from the jsp page?

session.invalidate() . But you need to refresh page to take effect. Note that generally that the session truly ends only when the browser window closes. The six most commonly used methods to invalidate a session are • Calling HttpSession.setMaxInactiveInterval(int secs) method, explicitly setting how many minutes the session will last. • The session will automatically be invalid after a certain time of inactivity (Tomcat default is 30 minutes). You need to remember that this 30 minutes is not a hard and fast rule for all servers. It might vary from one server to another and is configurable. So you can have it configured to last 25 mins in your server and I can have it to last 20 mins. • The user closes all browser windows. Note that, here the session will timeout rather than directly triggering a session invalidation. • The session will expire when it is explicitly invalidated by a servlet by calling invalidate(). • The server is stopped or crashes. Note that this event might not trigger a session invalidation. A Web container that permits failover might persist the session and allow a backup Web container to take over when the original server fails. • You can set the default timeout in the web.xml file ().

Related questions

Can I prevent the creation of a session in a JSP page?

Yes you can. Use the below line in your JSP page to accomplish it. <%@ page session="false" %>


How do you set the session variables in jsp?

The session variables can be accessed in a jsp page from the request object. Note: Accessing session contents in JSP is not a good design practice


What is doGet method in servlet?

The doGet() method is the method inside a servlet that gets called every time a request from a jsp page is submitted. The control first reaches the doGet() method of the servlet and then the servlet decides what functionality to invoke based on the submit request. The get method called when the type of page submission is "GET" There is another way of submitting requests from a jsp page is "POST" and when that happens it calls the doPost() method inside the servlet.


What is JSP Implicit objects?

In any JSP Page, there are a bunch of implicit objects that are available for the programmer to use. It contains a variety of information that can be used to display stuff on the page. The following JSP Implicit Objects are available for a programmer: • request • response • out • session • config • application • page • pageContext


What are the built in objects in jsp?

The correct term is "JSP Implicit Objects" In any JSP Page, there are a bunch of implicit objects that are available for the programmer to use. It contains a variety of information that can be used to display stuff on the page. The following JSP Implicit Objects that are available for a programmer. • request • response • out • session • config • application • page • pageContext


How-to clear the session values from the jsp page?

session.invalidate() . But you need to refresh page to take effect. Note that generally that the session truly ends only when the browser window closes. The six most commonly used methods to invalidate a session are • Calling HttpSession.setMaxInactiveInterval(int secs) method, explicitly setting how many minutes the session will last. • The session will automatically be invalid after a certain time of inactivity (Tomcat default is 30 minutes). You need to remember that this 30 minutes is not a hard and fast rule for all servers. It might vary from one server to another and is configurable. So you can have it configured to last 25 mins in your server and I can have it to last 20 mins. • The user closes all browser windows. Note that, here the session will timeout rather than directly triggering a session invalidation. • The session will expire when it is explicitly invalidated by a servlet by calling invalidate(). • The server is stopped or crashes. Note that this event might not trigger a session invalidation. A Web container that permits failover might persist the session and allow a backup Web container to take over when the original server fails. • You can set the default timeout in the web.xml file ().


What are the Implicit object in JSP?

The implicit objects in a JSP page are:requestresponsepageContextsessionapplicationoutconfigpage


What are the JSP lifecycle methods?

The 3 life cycle methods in a JSP page are:jspInit() - Called when the JSP page is initializedjspService() - Called everytime a request/response is received/submittedjspDestroy() - Called when the JSP is no longer required


What method do you override to initialize instance variables in a JSP declaration?

jsp init()


When you forward a JSP page which built-in JSP object goes out of scope?

application


Is it possible to include a doc file in a JSP page?

Yes. You can embed spreadsheets, pdfs and word documents in a JSP Page


What is session in jsp?

Session in the JSP and Servlet context refers to an instance of the HttpSession object that contains all the information about the current user session with the web application. This can be used as a cache or temporary storage area to store values that might be required across the application.