1

I am working on one project,and there i am facing one problem that when user gets logout from session he redirect to login.jsp page,but from there when he click on browser's back button he jumps to previous page.and I don't want allow user to press that back button for that purpose only i want to hide that button when session gets logout.I went through various links on google but that code didn't works.please help me to get out of this.If possible please guide me by code.and yes I am working on Struts2

Roman C
  • 49,761
  • 33
  • 66
  • 176
Patrick
  • 53
  • 1
  • 7
  • You can't hide the browser button because it's in browser, not the page. – Roman C Feb 28 '17 at 11:39
  • yes you are correct,i know that but is there any way to do that by coding ? – Patrick Feb 28 '17 at 11:43
  • I use this code <% String variable = (String) session.getAttribute("id"); System.out.println("variable session " + variable); if (variable == null) { System.out.println("inside if variable"); response.sendRedirect("index.jsp"); } else { System.out.println("Continue"); } %> – Patrick Feb 28 '17 at 11:45
  • but this code only redirects user to index.jsp/login.jsp – Patrick Feb 28 '17 at 11:46

0 Answers0