In JSP, a variable named
session
is implicitly available on each an every JSP page, which is the user's session.
In other words, there is no need to retrieve the session, as it is already available to you.
So, the below line is not necessary.
HttpSession session =request.getSession(true);
Now, remove this declaration line and try.