导入
BeanUtil包
这个包里面有一个DateLocalConvert转换器
try{
DateLocaleConverter convert = new DateLocaleConverter();
convert.convert(this.birthday, "yyyy-MM-dd");
}catch(Exception ex){//如果日期格式不正确那么这个时候就会抛出异常。
isOK = false;
}
如果格式正确还是抛异常,如是:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
那么就是缺少:
commons-logging.jar包
commons-logging.jar包的下载地址:http://115.com/file/e6ppduao#commons-logging.jar