日期:2014-05-17  浏览次数:20916 次

根据下拉列表的不同链接到不同页面,求高手
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
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 'select.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 rel="stylesheet" type="text/css" href="styles.css">
-->

  </head>
  
  <body>
  <script language="javascript" type="text/javascript">
  function ChangeItem()
  {
  var name=form.name.value;
  window.location.href="New.jsp?name="+name;
  }
  </script>
  <% String name="";
  if(request.getParameter("name")!=null)
  {
  name=request.getParameter("name");
  }
  %>
  <form name="form" method="post" action="">
  <tr>
  <td width="70" height="30">查询条件:</td>
  <td width="180"><div align="left">
  <select name="name" style="width:160;border:1px solid;" onChange="ChangeItem()">
  <option>请选择</option>
  <option value="1"<%if(name.equals("1")){%>selected<%} %>>按论文题目查询</option>
  <option value="2"<%if(name.equals("2")){%>selected<%} %>>按指导老师查询</option>
  <option value="3"<%if(name.equals("3")){%>selected<%} %>>按审核状态查询</option>
  <option value="4"<%if(name.equals("4")){%>selected<%} %>>按论题性质查询</option>
  </select>
  </div></td>
  </tr>
  <%if(name.equals("1")){%>
  <tr align="center">
  <td height="30">关键字</td>
  <td><input type="text" name="point"></td>
  </tr>
  <%}if(name.equals("2")){%>
  <tr align="center">
  <td height="30">关键字</td>
  <td><input type="text" name="point"></td>
  </tr>
  <%}if(name.equals("3")){%>
  <tr align="center">
  <td height="30">关键字</td>
  <td>
  <input type="radio" name="yi" value="radiobutton"/>已审核
<input type="radio" name="yi" value="radiobutton"/>未审核
  </td>
  </tr>
  <tr