日期:2014-05-18  浏览次数:20697 次

两个jsp select option中的值传递哪里错了
页面1       String roomId = request.getParameter("h_name");select去不出值为什么啊?
  <body> 
  <%
     String c_name = request.getParameter("c_name");
     String IDcard = request.getParameter("IDcard");
   // List allHouseType = DaoFactory.getHouseDaoInstance().getAll(0,DaoFactory.getHouseDaoInstance().getTotulRows(null,null,null),null,null,null);
   List allHouseType=DaoFactory.getHouseDaoInstance().getAllhouseType();
   %>
  <h2  ><font color="#004080">添加客户订房信息</font></h2>
  <hr color="#3366FF" />
  <center><font color="red">第二步:选择客房类型</font></center>
   <form action="./customer/customer_3.jsp" method="post" name="form"  onsubmit="return check()">
<table width="500" border="1"  bordercolor="#0033FF" align="center">
   <tr>
    <td height="50">选择房间类型</td>
     <td  align="left" height="50">
  <select name="h_name" id="h_name">
  <option value="">请选择房间类型</option>
  <%
      Iterator itor = allHouseType.iterator();
      while(itor.hasNext()){
      House d = (House)itor.next();
   %>
       <option value="<%=d.getId() %>"><%=d.getHouseType() %></option>
     <%
       }
      %>
   </select>
  </td>
  </tr>
  <tr>
    <td colspan="2"><input name="submit" type="submit" value="下一步" /></td>
  </tr>
</table>
<input name="c_name" type="hidden" value="<%=c_name %>">
<input name="IDcard" type="hidden" value="<%=IDcard %>">
</form>
  </body>
</html>

-------------------------------------------------------

页面2
 <body>
   <%
         String c_name = request.getParameter("c_name");
         String IDcard = request.getParameter("IDcard"); 
         String roomId = request.getParameter("h_name");
        // int h_id = Integer.parseInt(roomId);
       
         House h = DaoFactory.getHouseDaoInstance().getHouseById(roomId);
         String h_no[] = DaoFactory.getHouseDaoInstance().getRoomNo(roomId);
         
      %>
  <h2  ><font color="#004080">添加客户订房信息<%out.print(roomId);%><%out.print(c_name);%></font></h2>