Cannot convert 0 of type class java.lang.Integer to class java.lang.Boolean

时间:2023-03-08 16:53:34

org.apache.catalina.core.ApplicationDispatcher invoke

SEVERE: Servlet.service() for servlet jsp threw exception

javax.el.ELException: Cannot convert 0 of type class java.lang.Integer to class java.lang.Boolean

at org.apache.el.lang.ELSupport.coerceToBoolean(ELSupport.java:188)

at org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:416)

at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:188)

at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:935)

at org.apache.jsp.WEB_002dINF.jsp.Home_jsp._jspx_meth_c_005fif_005f4(Home_jsp.java:397)

at org.apache.jsp.WEB_002dINF.jsp.Home_jsp._jspService(Home_jsp.java:99)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)

at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:209)

at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:267)

at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1225)

at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1012)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)

at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

at java.lang.Thread.run(Thread.java:722)

遇到这种问题,仔细看看出错报告。然后再去找解决方法。

方法:jsp页面上,JSTL<c:if test="">表达式出错了,把一个int类型的数当做boolean来使用了。