<c:set var="ordertotalmoney" value="${sorder.so_bzmoney+ordertotalmoney}"/>
因为sorder.so_bzmoney定义的是String 类型,并带有小数点,例值:2800.12
我需要对他的值和ordertotalmoney定义的变量相加,怎么处理?
直接加有异常
javax.servlet.jsp.el.ELException: An exception occured trying to convert String "0.00" to type "java.lang.Long"
因为sorder.so_bzmoney定义的是String 类型,并带有小数点,例值:2800.12
我需要对他的值和ordertotalmoney定义的变量相加,怎么处理?
直接加有异常
javax.servlet.jsp.el.ELException: An exception occured trying to convert String "0.00" to type "java.lang.Long"
解决方案 »
- 新手问servlet和网页的关系
- java applet 安全策略问题
- 简单的问题 关于网页表现层框架
- iReport 报表问题
- 前段时间用jsp+sql+tomcat做了一网站 现在要发布 不知道怎么发布 有没有人知道 可否指点
- JSTL里如何输出List里面的Bean中的内容呢
- Unable to read TLD "META-INF/c.tld" from JAR file
- 一个关于将java文件编译成class文件的问题(急问)
- 150分求教:apache+tomcat的配置中的一部分,明天结帐.分不够可以再加.详情请进.
- asp只能在windows上运行吗,jsp可以在windows也可以在unix上运行吗
- 关于IE6异步树型问题!高手指点。
- struts1+spring+hibernate 环境下对数据库连接信息加密
pageEncoding="ISO-8859-1"%>
<%@ page import="org.test.Price" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
Price price = new Price();
price.setValue("45.3");
String test = "12.44";
request.setAttribute("price", price);
request.setAttribute("test", test);%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<c:set var="result" value="${test + price.value}"></c:set>
${result}</body>
</html>package org.test;public class Price {
private String value; public String getValue() {
return value;
} public void setValue(String value) {
this.value = value;
}
}没有任何问题啊
问题已经找到是
An exception occured trying to convert String "0.00" to type "java.lang.Long"
667: <c:if test="${sorder.so_money>0}">的错误,
改成<c:if test="${sorder.so_money>0.00}">就可以了