JSP exit code

I am using basic level authentication and I need a better JSP / Servlet exit code. I am using JSP and Servlet and MS-Access as backend.

Is session creation required in JSP?

0


a source to share


3 answers


if you want to "log out" of the application, try:



request.getSession () void () ;.

+2


a source


request.getSession () void (). won't work ... so 1 step after successful login, set session session.setAttribute ("loginstatus", "true"); when logging out, set the value to "false";



and for the login page after login: authentication.jsp which allows you to check the ststus of the "loginstatus" session if it is false and then forward it before the login page ... I think it will work ...

0


a source


If you are using Servlet 3.0 API use:

<a href="${pageContext.request.logout()}">Logout</a>

It works (tested and verified)!

0


a source







All Articles