我需要在java中计算bmi到目前为止我有这个代码
input_page.jsp
<form action="calc_bmi.jsp" method="post">
<table>
<tr>
<td>height:</td>
<td><input type="text" name="height" size="35" maxlength="6" ></td>
</tr>
<tr>
<td>weight:</td>
<td><input type="text" name="weight" size="35" maxlength="6" ></td>
</tr>
<tr>
<td colspan="2"><input type="button" onclick="formReset()" value="reset">
<input type="submit" value="submit"></td>
</tr>
</table>
</form>
calc_bmi.jsp
<%
String wt=request.getParameter("weight");
String ht=request.getParameter("height");
double weight=Integer.parseInt(wt);
double height=Integer.parseInt(ht);
double w=weight;
double h=height*height;
double bmi = w/h;
out.println("BMI of weight "+weight+" and height "+height+" is: "+bmi);
%>
我怎么能接受来自体重和身高字段的小数?
谢谢