Java. lang. NullPointerException:
1: java. lang. Double. parseDouble
Java code
Java. lang. NullPointerException
Sun. misc. FloatingDecimal. readJavaFormatString (FloatingDecimal. java: 991)
Java. lang. Double. parseDouble (Double. java: 510)
Com. huayu. shop. servlet. ProductCl. doPost (ProductCl. java: 115)
Javax. servlet. http. HttpServlet. service (HttpServlet. java: 710)
Javax. servlet. http. HttpServlet. service (HttpServlet. java: 803)
Com. huayu. filter. EncodeFilter. doFilter (EncodeFilter. java: 24)
Obviously, the problem lies in the line ProductCl. java: 115,
It may be because the passed value is null during type conversion, and a null pointer exception is reported.
You can use system. out. println ("") // output the passed value on the first line.
Or you can set a breakpoint on line 10 and debug it with debug. This will be helpful in the future.
Finally, the solution to this problem is:
Set the original
Double objNum = Double. parseDouble (list. get (I). getPctg_uv () * 350
/MaxNum;
Change
Double objNum = 0.0;
If (list. get (I). getPctg_amt () = null ){
} Else {
ObjNum = Double. parseDouble (list. get (I). getPctg_amt () * 350
/MaxNum;
}
Author "power of dreams"