自定义了一个日期类型转换期总是出错,源代码如下import java.util.Date;
import java.util.Map;import org.apache.struts2.util.StrutsTypeConverter;
import com.opensymphony.xwork2.conversion.TypeConversionException;public class DateConverter extends StrutsTypeConverter { private  final DateFormat[] dfs = {  // 支持转换的多种日期格式
new SimpleDateFormat("yyyy年MM月dd日"),
new SimpleDateFormat("yyyy-MM-dd"),
new SimpleDateFormat("yyyy/MM/dd") }; 
/**
 * 将指定格式字符串转换为日期类型
 */
public Object convertFromString(Map context, String[] values, 
Class toType) {
String dateStr = values[0];// 获取日期的字符串
System.out.println("datestr="+dateStr);

// 遍历日期支持格式,进行转换
for (int i=0;i<dfs.length;i++) {
try {
return dfs[i].parse(dateStr);
} catch (Exception e) {
System.out.println("第" +i+"个发生异常 ");
continue;
}
}

//如果遍历完毕后仍没有转换成功,表面出现转换异常。
throw new TypeConversionException("日期类型转换错误!");
//throw new RuntimeException("转换错误");



//return null;
}页面输入类似的1980-这样的格式的时候,页面就出现崩溃的那种错误....
请问这个到底哪里写错了呢?