Other JSP pages are opening in same jsp page
I am using JSP for different login user to open their own individual content.I used session and invalidated at the logout.jsp. So it is not opening the jsp pages after logout by copying the url and try to run in the browser. But i need a solution that, When i enter through login with one type of user (for eg:http://localhost:8080//CEO.jsp) it works fine if i give (for eg:http://localhost:8080//Staff.jsp) it is opening in same CEO.jsp page. I need that to not open . Please help me in this..
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" import="Accessing.UserBean"%>
<%@ taglib uri="/WEB-INF/tlds/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" >
javascript:window.history.forward(1);
</script>
<style>
.title
{
width:769px;
height: 65px;
margin:15px auto;
}
.left
{float: left;
margin: 20px 50px 20px 30px;
padding: 0 0 25px 15px;
width:700px;
border: 1px solid #CCCCCC;
background-color: #CC6699;
color: #990066;
}
.right_side
{
float:right;
width:580px;
color: #000000;
background-color: #FFFFFF;
margin: 20px 0px 20px 10px;
padding:0px 0px 25px 15px;
border:1px solid #CCCCCC;
}
</style>
</head>
<%
UserBean currentUser =(UserBean)session.getAttribute("currentSessionUser");%>
<%
try{
if((String)currentUser.getRoles()!=null)
{
%>
<body bgcolor=#CC9999>
<div class="title">
<div class="rightside">
<a href="signingout.jsp">Logout</a>
</div>
</div>
<div class="left">
<birt:viewer id="birtViewer" reportDesign="BankCredit.rptdesign"
pattern="frameset"
height="450"
width="700"
format="html">
</birt:viewer>
</div>
<%
}
else
response.sendRedirect("signin.jsp");
}
catch(Exception e)
{
out.println("<br><br><br><br><br开发者_开发知识库><br>");
out.println("<center><b><font color=red>SORRY!! ACCESS DENIED.INVALID USER.</font></b></center>");
out.println("<br><br>");
out.println("Please click here for <a href=signin.jsp><b>Login</b></a>");
}
%>
</body>
</html>
My approach to solving a problem such as this would be to cut the page down, removing more and more fragments until it's clear which lines are having the bad effect.
It should be possible to get it down to one or two lines which really show the problem.
精彩评论