Hi!
I'm having some trouble with sendRedirect. I check the session object to see if a user have access rights to a certain page.
If not, I try to redirect the user with sendRedirect. The problem is that on some pages, the browser renders the page he shouldn't have access to first, then a part of a html header, then it renders the page the user should be redirected to. If I reload the same page once more, the user is redirected correctly.
Anyone have a clue what's wrong?
This is the page I include in all my pages to limit access:
<%
if(session.getAttribute("SITEADM") == null){
response.sendRedirect("site_admin.jsp");
}else{
String adm = "";
adm = (String)session.getAttribute("SITEADM");
if(adm.equals("Ok")){
}else{
response.sendRedirect("site_admin.jsp");
}
}
%>