JSP参数转换出错.

liangkandy2002 2005-11-28 03:57:56
本SQLServer数据库字段是money型.
在JSP页面上,利用
<jsp:useBean id="invoice" scope="request" class="entities.Invoice"/>
<jsp:setProperty name="invoice" property="*"/>
出错.错误代码:
ERROR - Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: jsp.error.beans.property.conversion
at org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:885)
at org.apache.jasper.runtime.JspRuntimeLibrary.convert(JspRuntimeLibrary.java:267)
at org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:353)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:306)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspect(JspRuntimeLibrary.java:284)
at org.apache.jsp.jsp.invoiceMaintenance.modfiyInvoice_jsp._jspService(org.apache.jsp.jsp.invoiceMaintenance.modfiyInvoice_jsp:125)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:831)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:652)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1203)
at java.lang.Thread.run(Unknown Source)
由于Invoice类里,定义了BigDecimal,主要是setBigDecimal(),getBigDecimal()与
<jsp:setProperty name="invoice" property="*"/>
有数据转换的错误.如果在Invoice类里,定义更用float或者double型,由于精度问题,用float和double时有误差.高手帮助...
...全文
231 7 打赏 收藏 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
liangkandy2002 2006-01-17
  • 打赏
  • 举报
回复
没人回复,结贴
liangkandy2002 2005-11-30
  • 打赏
  • 举报
回复
d
liangkandy2002 2005-11-29
  • 打赏
  • 举报
回复
什么意思.
woolceo 2005-11-29
  • 打赏
  • 举报
回复
晕...楼主的bean...无语...
liangkandy2002 2005-11-29
  • 打赏
  • 举报
回复
以下是Bean代码:
package entities;
public class Invoice
{
private int voucherID;
private String voucherNumber; //存票票号
private String invoiceNumber; //发票编号
private String invoiceDate; //发票日期
private String dueDate; //最后期限
private String paymentDate; //支付日期
private int paymentTerm; //付款天数
private int paymentGracePeriod; //宽限天数
private float invoiceAmount; //发票总额
private BigDecimal discountAmount; //折扣金额
private float exchangeRate; //兑换率
private int invoiceTotalQuantity; //发票总粒数
private float invoiceTotalWeight; //发票总重量
private String differenceDescription; //价格差异描述
private String remarks; //发票备注
private int totalQuantity;
private float totalWeight;
private int status;
private String createdDate;
private String createdBy;

public CurrencyType currencyType;
public Buyer buyer;
public Vendor vendor;
public Material material;
public PublicFunc publicFunc;
/**
@roseuid 4233EDE50095
*/

public Invoice()
{
buyer=new Buyer();
vendor=new Vendor();
currencyType=new CurrencyType();
material=new Material();
publicFunc= new PublicFunc();
}

public int getVoucherID()
{
return voucherID;
}


/**
@return int
@roseuid 4233D8BA03BE
*/
public String getVoucherNumber()
{
return voucherNumber;
}

/**
@return String
@roseuid 4233D8C201DF
*/
public String getInvoiceNumber()
{
return invoiceNumber;
}

/**
@return java.sql.Date
@roseuid 4233D8CA019A
*/
public String getInvoiceDate()
{
return invoiceDate;
}

/**
@return java.sql.Date
@roseuid 4233D8D700F8
*/
public String getDueDate()
{
return dueDate;
}

/**
@return java.sql.Date
@roseuid 4233D8E00033
*/
public String getPaymentDate()
{
return paymentDate;
}

/**
@return int
@roseuid 4233D8E60349
*/
public int getPaymentTerm()
{
return paymentTerm;
}

/**
@return int
@roseuid 4233D8EE021E
*/

public int getPaymentGracePeriod()
{
return paymentGracePeriod;
}

/**
@return double
@roseuid 4233D8FB0281
*/
public float getInvoiceAmount()
{
return invoiceAmount;
}

/**
@return double
@roseuid 4233D9040234
*/
public BigDecimal getDiscountAmount()
{
return discountAmount;
}

/**
@return double
@roseuid 4233D9150057
*/
public float getExchangeRate()
{
return exchangeRate;
}

public int getInvoiceTotalQuantity()
{
return invoiceTotalQuantity;
}

public float getInvoiceTotalWeight()
{
return invoiceTotalWeight;
}

public int getTotalQuantity()
{
return totalQuantity;
}

public float getTotalWeight()
{
return totalWeight;
}
/**
@return String
@roseuid 4233D92000F3
*/
public String getDifferenceDescription()
{
return differenceDescription;
}

/**
@return String
@roseuid 4233D93C037F
*/
public String getRemarks()
{
return remarks;
}

public int getStatus()
{
return status;
}

public String getCreatedBy(){
return createdBy;
}

public String getCreatedDate(){
return createdDate;
}

public void setVoucherID(int voucherID)
{
this.voucherID=voucherID;
}


/**
@param int invoiceID
@roseuid 4233D95E0337
*/
public void setVoucherNumber(String voucherNumber)
{
this.voucherNumber=voucherNumber;
}

/**
@param invoiceNumber
@roseuid 4233D96D0375
*/
public void setInvoiceNumber(String invoiceNumber)
{
this.invoiceNumber=invoiceNumber;
}

/**
@param invoiceDate
@roseuid 4233D9810388
*/
public void setInvoiceDate(String invoiceDate)
{
this.invoiceDate=invoiceDate;
}

public void setDueDate(String dueDate)
{
this.dueDate=dueDate;
}

/**
@param paymentDate
@roseuid 4233D9900299
*/

public void setPaymentDate(String paymentDate)
{
this.paymentDate= paymentDate;
}

/**
@param paymentTerm
@roseuid 4233D99F00A6
*/
public void setPaymentTerm(int paymentTerm)
{
this.paymentTerm=paymentTerm;
}

/**
@param paymentGracePeriod
@roseuid 4233D9B303D0
*/
public void setPaymentGracePeriod(int paymentGracePeriod)
{
this.paymentGracePeriod=paymentGracePeriod;
}

/**
@param invoiceAmount
@roseuid 4233D9D50357
*/
public void setInvoiceAmount(float invoiceAmount)
{
this.invoiceAmount=invoiceAmount;
}

/**
@param discountAmount
@roseuid 4233DAB10349
*/
public void setDiscountAmount(BigDecimal discountAmount)
{
this.discountAmount=discountAmount;
}

/**
@param exchangeRate
@roseuid 4233D9F101BC
*/
public void setExchangeRate(float exchangeRate)
{
this.exchangeRate=exchangeRate;
}

public void setInvoiceTotalQuantity(int invoiceTotalQuantity)
{
this.invoiceTotalQuantity=invoiceTotalQuantity;
}

public void setInvoiceTotalWeight(float invoiceTotalWeight)
{
this.invoiceTotalWeight=invoiceTotalWeight;
}

/**
@param differenceDescription
@roseuid 4233DA0C0233
*/
public void setDifferenceDescription(String differenceDescription)
{
this.differenceDescription=differenceDescription;
}

/**
@param remarks
@roseuid 4233DA230381
*/

public void setRemarks(String remarks)
{
this.remarks=remarks;
}

public void setStatus(int status)
{
this.status=status;
}


public void setTotalQuantity(int totalQuantity)
{
this.totalQuantity=totalQuantity;
}

public void setTotalWeight(float totalWeight)
{
this.totalWeight=totalWeight;
}

public void setCreatedBy(String createdBy){
this.createdBy=createdBy;
}

public void setCreatedDate(String createdDate){
this.createdDate=createdDate;
}
public int updateInvoice(int userID)
{
//System.out.print(userID);
dbAccess dba=new dbAccess();
Date myDate = new Date();
SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyy-MM-dd");

String sql=
" update invoice set invoice_Number='"+getInvoiceNumber()+
"',Currency_type_id="+currencyType.getCurrencyTypeID()+
",Mt_ID="+material.getMtID()+
",Vendor_ID="+vendor.getVendorID()+",Buyer_ID="+buyer.getStaffID()+
",invoice_date='"+getInvoiceDate()+"',due_date='"+getDueDate()+
"',Payment_date='"+getPaymentDate()+"',Payment_term="+getPaymentTerm()+
",Payment_grace_period="+getPaymentGracePeriod()+",invoice_amount="+getInvoiceAmount()+
",Discount_amount="+getDiscountAmount()+",Exchange_Rate="+getExchangeRate()+
",Remarks='"+getRemarks()+"',total_Quantity="+getTotalQuantity()+
",total_Weight="+getTotalWeight()+",created_by="+userID+
",created_date='"+bartDateFormat.format(myDate)+"' where (voucher_Number='"+getVoucherNumber()+"')" +
" and (Status=0) " ;

System.out.print(sql);
return dba.execute(sql);
}
}
Bean的discountAmount变量定义成BigDecimal型,导致JSP的内部getX(),setX(),提示Bean属性转换出错.
wsk_228 2005-11-28
  • 打赏
  • 举报
回复
把bean放上来看一下。
liangkandy2002 2005-11-28
  • 打赏
  • 举报
回复
uping
【无人车路径跟踪】基于神经网络的数据驱动迭代学习控制(ILC)算法,用于具有未知模型和重复任务的非线性单输入单输出(SISO)离散时间系统的无人车的路径跟踪(Matlab代码实现)内容概要:本文介绍了基于神经网络的数据驱动迭代学习控制(ILC)算法,旨在解决具有未知模型和重复任务的非线性单输入单输出(SISO)离散时间系统中无人车的路径跟踪问题。该方法结合神经网络的学习能力与ILC的迭代优化机制,在无需精确系统模型的前提下,通过多次任务执行不断修正控制输入,以实现对期望轨迹的高精度跟踪。文章详细阐述了算法的设计原理、稳定性分析以及在无人车路径跟踪中的具体实现与仿真验证,展示了其在处理模型不确定性与提升跟踪精度方面的有效性。; 适合人群:具备自动控制、机器人或人工智能基础知识,从事无人车、自动化控制、智能系统研发的研究人员及工程师。; 使用场景及目标:①解决无人车在复杂环境下因系统模型未知或不精确导致的路径跟踪难题;②提升重复性作业中控制系统对理想轨迹的跟踪精度与鲁棒性;③为非线性、不确定性系统的先进控制策略设计提供理论参考与实践案例。; 阅读建议:建议读者结合Matlab代码实现进行学习,重点关注神经网络与ILC的融合机制、控制律的设计过程以及仿真结果的分析,以深入理解数据驱动方法在解决模型未知问题上的优势。
内容概要:本资源聚焦于分数阶系统(FOS)的Lyapunov指数谱计算,涵盖分数阶Lorenz系统、4D分数阶Chen系统和分数阶Duffing振荡器三种典型非线性动力学模型。通过提供完整的Matlab代码实现,系统介绍了分数阶微分方程的数值求解方法、李雅普诺夫指数谱的计算原理与算法流程,旨在帮助研究人员定量分析分数阶系统的混沌特性与动力学行为,为复杂系统的稳定性判定、分岔分析及混沌控制研究提供技术支撑。; 适合人群:具备一定动力系统与数值计算基础,从事非线性科学、混沌理论、分数阶微积分等相关领域研究的硕士、博士研究生及科研人员。; 使用场景及目标:① 学习和掌握分数阶微分方程的数值积分方法(如Adams-Bashforth-Moulton算法);② 深入理解Lyapunov指数谱的物理意义及其在判定系统混沌、稳定与周期运动中的应用;③ 利用提供的Matlab代码对特定分数阶系统进行动力学仿真与分析,复现经典结果或拓展至新的研究对象。; 阅读建议:此资源以Matlab代码为核心,强调理论与实践的紧密结合。使用者应在理解分数阶微积分基本理论和Lyapunov指数计算原理的基础上,仔细研读并调试所提供的代码,通过修改系统参数、初始条件等方式进行探究式学习,从而深化对分数阶系统复杂动力学行为的理解。
代码转载自:https://pan.quark.cn/s/447eda883a93 在本文中,我们将详细研究利用微控制器MSP430F5529来操控MPU6050传感器,并从其输出数据中推算出欧拉角。让我们来熟悉相关的主要构成部分。MSP430F5529是由德州仪器(TI)研发的一款16位超低功耗微控制器,它具备丰富的外部设备接口和强大的处理性能,非常适合多样化的嵌入式系统应用,尤其是传感器监控领域。MPU6050则是InvenSense公司推出的一款六轴惯性测量装置(IMU),该设备集成了三轴陀螺仪和三轴加速度计,能够检测设备的旋转状态和线性运动情况。 **一、MSP430F5529与MPU6050的连接** 1. **I2C通信协议**:MSP430F5529借助I2C总线与MPU6050进行数据交换。在I2C协议框架内,MSP430担任主设备角色,而MPU6050则扮演从设备角色。主设备负责控制数据传输过程,从设备则响应请求并传输数据。 2. **配置MPU6050**:在启动通信流程之前,必须设定MPU6050的工作模式、采样频率、满量程范围等参数。这一过程通常通过发送特定的I2C指令来完成。 3. **数据获取**:MPU6050的陀螺仪和加速度计数据通过I2C接口持续不断地或按需提供。微控制器周期性地读取这些数据,用以监控设备的动态变化情况。 **二、陀螺仪和加速度计原始数据解读** 1. **陀螺仪数据**:陀螺仪测量的是角速度,其单位通常是dps(度/秒)。该数据反映了设备围绕三个正交轴的旋转速度。 2. **加速度计数据**:加速度计测量的是线性加速度,其单位通常是g(重力加速度的倍数)。它能够感知设备在三个正交轴上的静态和动态加速度变化。...

81,108

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧