从JSP传回来的参数:request.getParameter(“p_width”) 是字符串类型。但是set这个参数的时候需要Double类型。
方法:String str = request.getParameter("str");
double dbl = Double.parseDouble(str);
实例:
String width =new String(request.getParameter("p_width").getBytes("ISO8859_1"),"utf-8");
Double p_width = Double.parseDouble(width);
product_info pi = new product_info();
pi.setP_width(p_width);