
Hii Sir, I am making a web app in which after logout one can go to back pages from the browsers back button which i dont want in my app.
Plz sir give me the desired code to solve this issue and plz specify where to use it
either in every page of in login page or at logout page.
Thank you Sir

Check out here for your requirement.
1)login.jsp:
<html> <head> <title>User Login</title> </head> <br> <body Bgcolor ="#0099cc"><hr><hr> <form method="POST" action="action.jsp"> <p><b>UserName:</b> <input type="text" name="UserName" size="10"></p> <p><b>Password:</b> <input type="Password" name="Password" size="10"></p> <p><input type="submit" value="Submit" name="submit"><input type= "reset" value="Reset" name="reset"></p><hr><hr> </form> </body> </html>
2)action.jsp:
<%@page import="java.util.*" %>
<script>
function go() {
window.location.replace("logout.jsp",'window','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
self.close()
}
</script>
<%String str = request.getParameter("UserName");
session.setAttribute("UserName", request.getParameter("UserName"));%>
Welcome to <%= session.getAttribute( "UserName" ) %>
<% if (session.getAttribute("UserName").equals("")){%>
<a href="login.jsp"><b>Login </b></a>
<%}
else{%>
<a href="javascript:go()"><b>Logout</b></a>
<%}
%>
3)logout.jsp:
<%session.invalidate();%> You have logged out. Please <a href="login.jsp"><b>Login</b></a>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.