当前位置:编程学习 > JAVA >>

学生党 作业求救 admin页面登录无法跳转 求解决方法

问题是:后台用户登录,无法跳转。没有显示错误


看了很多遍,没有发现错,我应该修改那里呢?
请各位大侠指点迷津。

以下是admin的  登录页面  jsp代码
<%@ page language="java" pageEncoding="GB18030"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>后台登陆</title>
    
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
overflow:hidden;
}
.STYLE3 {color: #528311; font-size: 12px; }
.STYLE4 {color: #42870a; font-size: 12px; }
-->
</style>
<script type="text/javascript">
function login(self) {
var name = document.getElementById("name");
var password = document.getElementById("password");
if(name.value != "" && password.value != "") {
self.href = "adminLoginServlet?name="+name.value+"&"+"password="+password.value;
}
}
function reset() {
var name = document.getElementById("name");
var password = document.getElementById("password");
name.value = "";
password.value = "";
}
</script>
  </head>
  
  <body>
    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#e5f6cf"> </td>
  </tr>
  <tr>
    <td height="608" background="Admin/images/login_03.gif">
     <table width="862" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="266" background="Admin/images/login_04.gif"> </td>
      </tr>
      <tr>
        <td height="95">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="424" height="95" background="Admin/images/login_06.gif"> </td>
            <td width="183" background="Admin/images/login_07.gif">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="21%" height="30"><div align="center"><span class="STYLE3">用户</span></div></td>
                <td width="79%" height="30"><input type="text" id="name" name="name"  style="height:18px; width:130px; border:solid 1px #cadcb2; font-size:12px; color:#81b432;"></td>
              </tr>
              <tr>
                <td height="30"><div align="center"><span class="STYLE3">密码</span></div></td>
                <td height="30"><input type="password" id="password" name="password"  style="height:18px; width:130px; border:solid 1px #cadcb2; font-size:12px; color:#81b432;"></td>
              </tr>
              <tr>
                <td height="30"> </td>
                <td height="30"><img src="Admin/images/dl.gif" width="81" height="22" border="0" usemap="#Map">
                <div style="color: red;font-size: 12px;display: inline;">${message}</div></td>
              </tr>
           </table>
          </td>
             <td width="255" background="Admin/images/login_08.gif"> </td>
     </tr>
      </table>
        </td>
      </tr>
      <tr>
        <td height="247" valign="top" background="Admin/images/login_09.gif">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22%" height="30"> </td>
            <td width="56%"> </td>
            <td width="22%"> </td>
          </tr>
          <tr>
            <td> </td>
            <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                         </table>
       </td>
       <td> </td>
      </tr>
        </table>
       </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="#a2d962"> </td>
  </tr>
</table>
<map name="Map">
<area shape="rect" coords="3,3,36,19" style="cursor: pointer;" onclick="login(this)">
<area shape="rect" coords="40,3,78,18" onclick="reset()">
</map>
  </body>
</html>
--------------------编程问答-------------------- <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<base href="<%=basePath%>">


去掉 --------------------编程问答-------------------- 你确定请求能到后台么,可以试试location.href --------------------编程问答-------------------- 提交表单信息验证
你页面缺少form --------------------编程问答-------------------- 亲测,完美跳转。不知道你的是什么情况。 --------------------编程问答-------------------- 测试环境myeclipse8.5  
3楼的人家用地址重写可以不用表单的。。 --------------------编程问答-------------------- 缺少表单form
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,