刚才的问题重新编辑后,高分求答案!
我把我的登陆界面index.jsp和登陆后跳转的主界面success.jsp代码发在上面
web形式的不是可以直接在地址烂里输入http://localhost:8084/success.jsp 而没有通过index.jsp.jsp嘛!现在要实现的功能是当非法输入后发现没经过index.jsp便弹到index.jsp要求登陆.不要用struts,直接session就行.麻烦把该加的代码加到相应位置!试了好几个都不对!
index.jsp
<%@page contentType= "text/html "%>
<%@page pageEncoding= "gb2312 "%>
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
</head>
<body>
<script language= "JavaScript ">
function RgTest() {
if(document.login.userId.value== " ") {
window.alert( "请输入用户名! ");
document.login.userId.focus();
return false;
}
if(document.login.passwd.value== " ") {
window.alert( "请输入密码! ");
document.login.passwd.focus();
return false;
}
return true;
}
</script>
<center>
<h1> <font color= "#0099CC "> 欢迎光临××运输管理系统 </font> </h1>
<form method= "POST " action= "check_login.jsp " name= "login ">
<table border= "1 " bgcolor= "#0099CC " align= "center ">
<tr> <td>
<table>
<tr bgcolor= "#009966 " bordercolor= "#990066 ">
<td align= "right "> 姓名: </td>
&n