1.http status 500错误
2.java.lang.NullPointerException
http status 500错误
String sidd=(String)request.getParameter("fid");
if (sidd==null || "".equals(sidd)) sidd="0";
int id=Integer.parseInt(sidd);
试试呢..
加个判空,米人源码可能是fid参数没传过来,null转整型抛异常了.
java.lang.NullPointerException
å¾å¤å¯è½ä¸ºnullçæ åµä½ é½æ²¡å¤çï¼å½ç¶ä¼åºNullPointerException é误
æ¯å¦ï¼
String username=request.getParameter("username");
String password=request.getParameter("password");
String str="select * from tb_user where"+"username="+username+"and password="+password;
åºè¯¥æ¹æï¼
String username=request.getParameter("username");
String password=request.getParameter("password");
if(username != null && password != null){
String str="select * from tb_user where"+"username="+username+"and password="+password;
â¦â¦â¦â¦â¦â¦
â¦â¦â¦â¦â¦â¦
}
ä¸é¢ç代ç èªå·±åæ£æ¥æ£æ¥ï¼ç±»ä¼¼çæ åµé½è¦å å¤æ