发布在tomcat下,一直运行没问题,今天去吃晚饭回来,继续做了几个页面,跑来看时突然发现以前有个页面的button按了什么反应没有。
查资料书,又baidu还是搞不清楚到底因为啥?重新发布还是不行...路过的大大们。。求拯救。。明天上午要交这个项目作业。  欲哭啊...
button失效的jsp页面代码如下:<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
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>My JSP 'vetSearch.jsp' starting page</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">

<link href="layout.css" rel="stylesheet" type="text/css" />   <script type="text/javascript" language="javascript">
<!--
function check2(){
       if(document.petS.pet_name.value==""&&document.petS.pet_owner.value==""){
         alert("请输入一个查询项!");
         document.petS.pet_name.focus();
         document.petS.pet_owner.focus();
         return false;
       }else{
         document.petS.action="petSearch";
         return true;
    }
    function exit(){
      window.location.href("employeeLogin.jsp");
    }
    function addPet(){
      window.location.href("addPet.jsp");
    }
    function addOwner(){
      window.location.href("addOwner.jsp");
    }
    -->
</script> </head>
  
  <body>
  <div id="container">
   <div id="header"><hr><h1><center>宠物查询</center></h1></div>
   <div id="menu">
     <br/>
     <p class="one">【宠物】</p>&nbsp;&nbsp;
     <p class="two"><a href="vetSearch.jsp">【兽医】</a></p>
     <p class="three"><a onclick="exit()">【退出】</a></p>
   </div>
   <div id="mainContent">
     <form method="post" name="petS" onsubmit="return check2()">
       <table align="center"  cellspacing="10">
         <tr><td>宠&nbsp;物&nbsp;名&nbsp;称:</td>
             <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="pet_name"></td></tr>
         <tr><td>所有人名称:</td>
             <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="pet_owner"></td></tr>
         <tr><td colspan="2" align="center">
             
             <input type="submit" value="查询">
             <input type="button" value="增加新宠物" disables="false" onclick="addPet()">
             <input type="button" value="增加新所有人" disables="false" onclick="addOwner()"></td></tr>
       </table>
     </form>
   </div>
   <div id="footer">
    <center><h1><%=request.getAttribute("")%></h1></center>
   </div>
  </div>
  </body>
</html>
别的页面都没问题。仅仅是跳转的button都失效了...应该跟配置文件还有servlet没关系的。