Cannot convert 0:0 of type class java.lang.String to class java.lang.Long
来源:互联网 发布:阿里云个人备案要多久 编辑:程序博客网 时间:2024/06/10 12:08
<----jsp页面内容---->
<span class="sp">订单状态:
<c:if test="${prop.status == 0}"><font color="#000080">下单登记</font></c:if>
<c:if test="${prop.status == 1}"><font color="green">支付成功</font><img src="images/g.gif"></c:if>
<c:if test="${prop.status == 3}"><font color="red">待支付</font><img src="images/X.gif"></c:if>
<c:if test="${prop.status == 2}"><font color="blue">支付确认</font><img src="images/f.gif"></c:if>
<c:if test="${prop.status == -1}"><font color="red">支付失败</font><img src="images/X.gif"></c:if>
</span>
造成错误:
javax.el.ELException: Cannot convert 0:0 of type class java.lang.String to class java.lang.Long
at org.apache.el.lang.ELSupport.coerceToNumber(ELSupport.java:296)
at org.apache.el.lang.ELSupport.coerceToNumber(ELSupport.java:275)
at org.apache.el.lang.ELSupport.equals(ELSupport.java:120)
at org.apache.el.parser.AstEqual.getValue(AstEqual.java:39)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:938)
at org.apache.jsp.pages.si.list_jsp._jspx_meth_c_005fif_005f13(list_jsp.java:750)
at org.apache.jsp.pages.si.list_jsp._jspx_meth_c_005fforEach_005f0(list_jsp.java:637)
at org.apache.jsp.pages.si.list_jsp._jspService(list_jsp.java:200)
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:388)
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.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:157)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
造成原因:status为string型,而页面判断的是整形,所以报错
修改方法:<span class="sp">订单状态:
<c:if test="${prop.status == ‘0’}"><font color="#000080">下单登记</font></c:if>
<c:if test="${prop.status == ‘1’}"><font color="green">支付成功</font><img src="images/g.gif"></c:if>
<c:if test="${prop.status == ‘3’}"><font color="red">待支付</font><img src="images/X.gif"></c:if>
<c:if test="${prop.status == ‘2’}"><font color="blue">支付确认</font><img src="images/f.gif"></c:if>
<c:if test="${prop.status == ‘-1’}"><font color="red">支付失败</font><img src="images/X.gif"></c:if>
</span>
- Cannot convert 0:0 of type class java.lang.String to class java.lang.Long
- Cannot convert 临时用户 of type class java.lang.String to class java.lang.Long
- Cannot convert 0 of type class java.lang.Integer to class java.lang.Boolean
- javax.el.ELException: Cannot convert 1 of type class java.lang.String to int
- javax.el.ELException: Cannot convert 2015-12-03 18:50 of type class java.lang.String to class java.u
- javax.el.ELException Cannot convert 0e27d734-c316-4e13-8770-161092a2b3c4 of type class java.lang.Str
- 配置Spring Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource]
- jsf配置问题 Error performing conversion of value ' of type class java.lang.String to type class
- Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'xxx'
- Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'xxx'
- Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching e
- java.lang.Long cannot be cast to java.lang.String
- 解决:Failed to convert value of type 'java.lang.String' to required type 'java.util.Date';
- java.lang.IllegalArgumentException: Cannot convert value of type [] to required type [] for property
- java.lang.IllegalArgumentException: Cannot convert value of type [] to required type [] for propert
- Failed to convert property value of type [java.lang.String] to required type [boolean] for property
- Failed to convert value of type 'java.lang.String' to required type 'org.springframework.web.multipa
- springmvc-- Failed to convert property value of type 'java.lang.String' to required type
- Strust2源码序列图
- 【算法题】求数组中子数组的最大乘积
- dota宽屏
- 多线程案例学习
- lucenc setBoost增加权重值
- Cannot convert 0:0 of type class java.lang.String to class java.lang.Long
- linux proc/pid/fd 查看 fd 对应的设备
- IOS开发基础
- 数据结构演示(动画逼真)形象
- shell中的大括号和小括号
- Linux设备驱动之I/O端口与I/O内存
- css3 简单渐变。。。
- 用ViewGroup 实现滑屏效果
- Android listview在滚动的时候部分背景会变黑与cacheColorHint有关的解决办法