How to disable session Using JSP

In this post i will explain the easy process to disable session creation in the JSP pages. Disabling the session in some pages will improve the performance of your web application in JSP. Every time a JSP is requested, JSP creates Associate in Nursing HttpSession object to take care of state for every distinctive shopper. The session information is accessible within the JSP because the implicit session object. In JSPs, sessions area unit enabled by default.

Session object uses the server resources. every session object uses up atiny low quantity of system resources because it is keep on the server aspect. This conjointly will increase the traffic because the session ID is distributed from server to shopper. shopper conjointly sends identical session ID along side every request. If a number of the JSP pages on your data processor have gotten thousands of hits from web browser and there’s not have to be compelled to determine the user, thus its higher to disable the session there in JSP page.

Disable Session in Java

Below code will set your session attribute of the page directive to false, as shown in the following example:

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Article Tags: , , ,