從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);