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

请大家帮忙看下
我出现了一个问题就是选择药品名称时,可以出现它的药品规格和药品价格相对应记录,但是刷新页面得到的不是我选择的药品名称.而是出现的刚进入界面的(请选择药品名称).怎么样修改呢?我把代码贴出来了,谢谢了,毕业设计等着急.
<%@   page   import= "java.sql.*,java.util.* "%>
<%@   include   file= "../include/ccs.inc "%>
<%@   page   language= "java "
import= "java.util.*,com.mytest.Hospital.Patient,com.mytest.Hospital.Doctor,com.mytest.Hospital.Drug "
pageEncoding= "gbk "%>
<%@   page   contentType= "text/html;charset=GBK "%>
<jsp:useBean   id= "NurseBeanBusiness "
class= "com.mytest.Hospital.NurseBean "   scope= "page "> </jsp:useBean>

<jsp:useBean   id= "patient "   class= "com.mytest.Hospital.Patient "
scope= "page "> </jsp:useBean>
<jsp:useBean   id= "drug "   class= "com.mytest.Hospital.Drug "   scope= "page "> </jsp:useBean>
<jsp:setProperty   name= "patient "   property= "* "   />
<html>
<head>
<script   language= "javascript ">
function   show(drug_name)

{
var   url   =   "InputEveryDayInfo.jsp?drug_name= "   +   drug_name;
    window.location=url;

}

 
function   change(drug_name)
{
   
    var   url= "InputEveryDayInfo.jsp "
    var   url1= "InputEveryDayItemInfo.jsp "
  if(window.confirm( "是否还需要添加药品? ")){      
  window.location=url;
 
                return       url;      
            }      
            window.location=url1;
  return     url1;
         
}
</script>
</head>



<body   bgcolor= "#FFFFFF ">

<%

double   drug_cost=0;
String   drug_basic_unit= " ";
String   drug_name=request.getParameter( "drug_name ");
if(drug_name==null||drug_name.equals( " "))
{
drug_name= "请选择药品名字 ";
}
else{
byte   b[]=drug_name.getBytes( "ISO-8859-1 ");
        drug_name=new   String(b);}
Iterator   it1   =   NurseBeanBusiness.getdrugotherInfo(drug_name);
while   (it1.hasNext())   {
Drug   drug2   =   (Drug)   it1.next();
  drug_cost=drug2.getDrugCost();
  drug_basic_unit=drug2.getDrugBasicUnit();
}


   
  %>

<table   width= "770 "   height= "423 "   border= "0 "   align= "center "
cellpadding= "0 "   cellspacing= "1 "   bgcolor= "#000000 ">
<tr>
<td   height= "421 "   bgcolor= "#FFFFFF ">
<table   width= "770 "   border= "0 "   align= "center "   cellpadding= "0 "
cellspacing= "0 ">
<tr>