User userSession=(User) session.getAttribute("LOGINEN_USER");
if(userSession == null || userSession.getStatus()!=0){
out.print("<script type='text/javascript'>alert('您尚未登录或者超时');</script>");
out.print("<script type='text/javascript'>location.href='../login.jsp'</script>");
}
<html>
<head>
<!--这个是引入js文件-->
<script src="" ></script>
</head>
<body>
<script>
//内嵌的js代码
</script>
</body>
</html>
本回答被网友采纳