Home > Back-end >  I am sure that the value is not empty do not contain characters of pure digital why to hold the wron
I am sure that the value is not empty do not contain characters of pure digital why to hold the wron

Time:10-28

 Java. Lang. A NumberFormatException: For input string: "pid" 
The at Java. Lang. A NumberFormatException. ForInputString (65). A NumberFormatException Java:
The at Java. Lang. Integer. ParseInt (Integer. Java: 580)
The at Java. Lang. Integer. ParseInt (Integer. Java: 615)
The at javax.mail. El. ListELResolver. Coerce (ListELResolver. Java: 157)
The at javax.mail. El. ListELResolver. GetValue (ListELResolver. Java: 70)
The at org. Apache. Jasper. El. JasperELResolver. GetValue (JasperELResolver. Java: 110)
The at org. Apache. El. Parser. AstValue. GetValue (AstValue. Java: 169)
The at org. Apache. El. ValueExpressionImpl. GetValue (ValueExpressionImpl. Java: 184)
The at org. Apache. Jasper. Runtime. PageContextImpl. Called proprietaryEvaluate (PageContextImpl. Java: 943)
The at org. Apache. JSP. Admin. Paper. Main_jsp. _jspService (main_jsp. Java: 486)
The at org. Apache. Jasper. Runtime. HttpJspBase. Service (HttpJspBase. Java: 70)
The at javax.mail. Servlet. HTTP. HttpServlet. Service (HttpServlet. Java: 729)
At org. Apache. Jasper. Servlet. JspServletWrapper. Service (438) JspServletWrapper. Java:
The at org. Apache. Jasper. Servlet. JspServlet. ServiceJspFile (JspServlet. Java: 396)
At org. Apache. Jasper. Servlet. JspServlet. Service (340) JspServlet. Java:
The at javax.mail. Servlet. HTTP. HttpServlet. Service (HttpServlet. Java: 729)
The at org. Apache. Catalina. Core. ApplicationFilterChain. InternalDoFilter (ApplicationFilterChain. Java: 292)
The at org. Apache. Catalina. Core. ApplicationFilterChain. DoFilter (ApplicationFilterChain. Java: 207)
At org, apache tomcat, websocket server WsFilter. DoFilter (WsFilter. Java: 52)
The at org. Apache. Catalina. Core. ApplicationFilterChain. InternalDoFilter (ApplicationFilterChain. Java: 240)
The at org. Apache. Catalina. Core. ApplicationFilterChain. DoFilter (ApplicationFilterChain. Java: 207)
The at org. Apache. Catalina. Core. ApplicationDispatcher. Invoke (ApplicationDispatcher. Java: 716)
The at org. Apache. Catalina. Core. ApplicationDispatcher. The processRequest (ApplicationDispatcher. Java: 466)
The at org. Apache. Catalina. Core. ApplicationDispatcher. DoForward (ApplicationDispatcher. Java: 391)
The at org. Apache. Catalina. Core. ApplicationDispatcher. Forward (ApplicationDispatcher. Java: 318)
At com. Finup. Servlet. PaperServlet. FindById (PaperServlet. Java: 109)
At com. Finup. Servlet. PaperServlet. DoPost (PaperServlet. Java: 62)
At com. Finup. Servlet. PaperServlet. DoGet (42 PaperServlet. Java:)
The at javax.mail. Servlet. HTTP. HttpServlet. Service (HttpServlet. Java: 622)
The at javax.mail. Servlet. HTTP. HttpServlet. Service (HttpServlet. Java: 729)

The JSP code
 & lt; C: forEach items="${requestScope. List}" var="list" & gt; 

${list. Pid} & lt;/td>
${list. The pname} & lt;/td>
The ${list. Pnumber} & lt;/td>
${list. Pstate} & lt;/td>





The servlet
 String spage=request. The getParameter (" page "); 
String id=request. The getParameter (" pid ");
Int pid=Integer. ParseInt (id);
List Listall=paperService. FindById (pid);
Int page;
Int size=3;
If (spage=="") {
Page=1;

} else {
Page=Integer. ParseInt (spage);
}
Int pageCount;
Int count=listall. The size ();
If (size==0) count % {
PageCount=count/size;
} else {
PageCount=(count/size) + 1;
}
If (count<{
=3)Request. SetAttribute (" list ", listall);

} else {
List Listall2=paperService. FindById (pid);
Question que=new Question ();
List List=new ArrayList ();
Listall2. Add (que);
Int start=(page 1) * size;
Int the end=start + size;
List=listall the subList (start, end);
Request. SetAttribute (" list ", a list);
}
String MSG="all";
Request. SetAttribute (" pageCount ", pageCount);
Request. SetAttribute (" count ", count);
Request. SetAttribute (" MSG ", MSG);
Request. GetRequestDispatcher (" admin/paper/main. JSP "). The forward (request, response);


CodePudding user response:

Integer. The parseInt (id); To Interger. The valueOf (id) or String id=request. The getParameter (" pid ") into an int id=request. The getParameter (" pid ");

CodePudding user response:

The error must be an Integer. The parseInt () throws exceptions, throw in the way a NumberFormatException. ForInputString (s), show that the "pid" is the value, the debug debugging, the value should be wrong

CodePudding user response:

reference 1/f, anonymous street response:
Integer. The parseInt (id); To Interger. The valueOf (id) or String id=request. The getParameter (" pid ") into an int id=request. The getParameter (" pid ");

Still won't do I pass the pid is 1, the transformation is 1, but I'm still an error
  • Related