using jsp Create a sample page for login and when i enter the correct string moves to inner page and when i clicked logout it redirect to home page from there when i click the back button it goes to my inner page how to avoid that
my login page
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-request-directive" content="no-cache">
<meta http-equiv="cache-response-directive" content="must-revalidate">
</title>
</head>
<body>
<form name="f1" method="post" action="inner.jsp" />
<input type="text" name="user" id="user"/>
<input type="password" name="pass" id="pass"/>
<input type="submit" name="login" id="log" value="login"/>
</form>
</body>
</html>
innerpage
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-request-directive" content="no-cache">
<meta http-equiv="cache-response-directive" content="must-revalidate">
</title>
</head>
<body>
<%String user=request.getParameter("user");
String pass=request.getParameter("pass");
String s="aji";
session.setAttribute("user",user);
if(user.compareTo(s.toString()) >0)
{
response.sendRedirect("index.jsp");
}
else
{
String username=session.getAttribute("user").toString();
out.print(username);
}
%>
<form action="temp.jsp">
<input type="submit" value="logout" />
</form>
</body>
</html>
3ed page
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-request-directive" content="no-cache">
<meta http-equiv="cache-response-directive" content="must-revalidate">
</title>
</head>
<body>
<%session.invalidate();
response.sendRedirect("index.jsp"); %> <br>
</body>
</html>