title: SEVERE: Servlet.service() for servlet [jsp] threw exception java.lang.NumberFormatException
body: <p>I am trying to display Candidates information on JSP from two items lists viz. Personal Info - "${candidatesPI}" and Fitness Info - "${candidatesFI}". </p>
  
  <p>Below is the JSP code to display the information from two lists. Here I am storing the Candidate ID information from these two lists using two variables var1 and var2 and then doing comparison. The error is shown while storing the value of CandidateID into var1 variable.</p>
  
  <pre><code>&lt;c:forEach var="tempcandDet" items="${candidatesPI}" varStatus="counter"&gt;
  
                  &lt;c:url var="CanDet" value="/aro/searchByAadhaar"&gt;
                          &lt;c:param name="AadhaarNo" value="${tempcandDet.aadhaarNumber}" /&gt;
                          &lt;c:param name="candidateID" value="${tempcandDet.candidateID}" /&gt;
                      &lt;/c:url&gt;
                  &lt;c:url var="updateLink" value="/aro/showFormForUpdate"&gt;
                          &lt;c:param name="candidateID" value="${tempcandDet.candidateID}" /&gt;
                      &lt;/c:url&gt;
  &lt;tr&gt;
      &lt;%-- &lt;td class="DashboardTabledata" style="text-align:left"&gt;${counter.count}&lt;/td&gt; --%&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;&lt;a href="${CanDet}"&gt;${tempcandDet.aadhaarNumber}&lt;/a&gt;&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet.firstName}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet.middleName}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet.lastName}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet.postApplied}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:center;font-size: 14px;"&gt;${tempcandDet.eligible}&lt;/td&gt;
      &lt;c:forEach var="tempcandDet1" items="${candidatesFI}" varStatus="counter"&gt;
      &lt;c:set var="var1" value="${tempcandDet1.candidateID_FI}"/&gt;
      &lt;c:set var="var2" value="${tempcandDet.candidateID}"/&gt;
      &lt;c:choose&gt;
          &lt;c:when test='${var1==var2}'&gt;
      &lt;td class="DashboardTabledata" style="text-align:center;font-size: 14px;"&gt;${tempcandDet1.runningScore}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet1.pullUpsScore}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet1.balance}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet1.ditch}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet1.medical}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet1.surgical}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet1.eye}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet1.ent}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet1.ceeScore}&lt;/td&gt;
       &lt;/c:when&gt;
       &lt;/c:choose&gt;
       &lt;/c:forEach&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet.score}&lt;/td&gt;
      &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet.result}&lt;/td&gt;
      &lt;%-- &lt;td class="DashboardTabledata"&gt;&lt;a href="${updateLink}"&gt;Update&lt;/a&gt;&lt;/td&gt; --%&gt;
  
    &lt;/tr&gt;
  
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>I am getting below error - </p>
  
  <pre><code>Aug 07, 2018 5:01:32 PM org.apache.catalina.core.ApplicationDispatcher invoke
  SEVERE: Servlet.service() for servlet [jsp] threw exception
  java.lang.NumberFormatException: For input string: "candidateID_FI"
      at java.lang.NumberFormatException.forInputString(Unknown Source)
      at java.lang.Integer.parseInt(Unknown Source)
      at java.lang.Integer.parseInt(Unknown Source)
      at javax.el.ArrayELResolver.coerce(ArrayELResolver.java:144)
      at javax.el.ArrayELResolver.getValue(ArrayELResolver.java:61)
      at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110)
      at org.apache.el.parser.AstValue.getValue(AstValue.java:169)
      at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
      at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:115)
      at org.apache.jsp.WEB_002dINF.view.MainPage_005fARON_jsp._jspx_meth_c_005fset_005f9(MainPage_005fARON_jsp.java:3509)
      at org.apache.jsp.WEB_002dINF.view.MainPage_005fARON_jsp._jspx_meth_c_005fforEach_005f1(MainPage_005fARON_jsp.java:3461)
      at org.apache.jsp.WEB_002dINF.view.MainPage_005fARON_jsp._jspx_meth_c_005fforEach_005f0(MainPage_005fARON_jsp.java:3225)
      at org.apache.jsp.WEB_002dINF.view.MainPage_005fARON_jsp._jspService(MainPage_005fARON_jsp.java:357)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:444)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:170)
      at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:314)
      at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1325)
      at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1069)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1008)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:870)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
  
  Aug 07, 2018 5:01:32 PM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/SRS-ARONAGPUR] threw exception [An exception occurred processing [WEB-INF/view/MainPage_ARON.jsp] at line [511]
  
  508:     &lt;td class="DashboardTabledata" style="text-align:left;font-size: 14px;"&gt;${tempcandDet.postApplied}&lt;/td&gt;
  509:     &lt;td class="DashboardTabledata" style="text-align:center;font-size: 14px;"&gt;${tempcandDet.eligible}&lt;/td&gt;
  510:     &lt;c:forEach var="tempcandDet1" items="${candidatesFI}" varStatus="counter"&gt;
  511:     &lt;c:set var="var1" value="${tempcandDet1.candidateID_FI}"/&gt;
  512:     &lt;c:set var="var2" value="${tempcandDet.candidateID}"/&gt;
  513:     &lt;c:choose&gt;
  514:        &lt;c:when test='${var1==var2}'&gt;
  </code></pre>
  
  <p>I am using Spring MVC framework. Is this issue specific to JSP or Spring MVC classes? Please let me know.</p>