logout jsp
I have controller and a jsp in the controller I provides the name for the jsp (logout.jsp).
Contoller code
String actionType = RequestUtil.getActionType(req);
if(actionType.equalsIgnoreCase("logout")){
System.out.println("Loging off");
String page = "/logout.jsp";
dispatch(req, resp, page);
in my logout.jsp I have
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<TITLE>logout.jsp</TITLE>
</HEAD>
<BODY>
<%
request.getSession().invalidate();
response.sendRedirect(response.encodeRedirectUrl("/login.jsp"));
window.history.forward(1);
%>
</BODY>
</HTML>
but here I can not see my page as redirected to login.jsp. it just stays to logout...
any idea why this is happening...
is it because of the dispatch method.
also how do I redirect user to login.jsp after clicking back button.
your help is always appreciated.
|