[ServletException in:/jsp/auction/bk_editCommodityPreview.jsp] Unable to convert string '2006-05-16' to class java.sql.Timestamp for attribute end_date: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager' 
要如何解决........我在form里面end_date得类型是date,页面上得end_date得值是由一个时间控件获取得,,info里得end_date是Timestamp类型

解决方案 »

  1.   

    Unable to convert string '2006-05-16' to class java.sql.Timestamp for attribute end_date:
    这里说的很清楚了,你不能直接把String型的转化为Timestamp型的。
    API 里 Timestamp有方法:
    public static Timestamp valueOf(String s)
    Converts a String object in JDBC timestamp escape format to a Timestamp value. Parameters:
    s - timestamp in format yyyy-mm-dd hh:mm:ss.fffffffff 
    Returns:
    corresponding Timestamp value 
    Throws: 
    IllegalArgumentException - if the given argument does not have the format yyyy-mm-dd hh:mm:ss.fffffffff
      

  2.   

    这个我明白....我现在得问题是在页面通过控件获取了时间后,,还没有转到ACTION里就报了这个异常给我哦,,我在ACTION里面已经做了类型转换..........而且页面提交到form里得,,我form里得时间类型是date,
    在我其他页面跟action里也是一样得,都是用同一个form跟info,但是却没有报这个异常给我......
      

  3.   

    建议楼主不要用date格式的,这个转换比较麻烦,最好是字符型的,转换成任何格式都较方便