I want to disconnect from a jsp page, in order to do that, here's what I tried :
In my JSP (accueil_mobile.jsp) I got this :
<form action="b" method="POST">
<input type="submit" value="Deconnexion" />
</form>
b refers to a SERVLET of which post's method is as follows :
public static final String VUE = "/accueil_mobile.jsp" ;
.
.
.
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.getSession().invalidate();
response.sendRedirect("accueil.xhtml");
this.getServletContext().getRequestDispatcher(VUE).forward(request, response) ;
}
Now I expected this to invalidate the session and redirect me to accueil.xhtml
, but all it does is load indifinitly the page. Why is that ?
Thanks.