ProAnswers.org

Why is it not a good practice to create HttpSessions in JSPs by default?

Why is it not a good practice to create HttpSessions in JSPs by default?

By default, JSP files create HttpSessions. This is in compliance with J2EETM to facilitate the use of JSP implicit objects, which can be referenced in JSP source and tags without explicit declaration. HttpSession is one of those objects. If you do not use HttpSession in your JSP files then you can save some performance overhead with the following JSP page directive: