数据库里时间映射出来是date类型 可以在你的实体类里多加一个get and set方法:
本来是
private date time;
public void setTime(date time){
this.time=time;
}public date getTime(){
return this.time;
}多加一个get setpublic void setTime1(String time1){
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); 
try{
this.time=sdf.parse(time1);
}catch(Exception e){
e.printStackTrace();
}
}public String getTime1(){
return this.time.toString();
}然后在提交页面把时间标签的name设置为 类名.time1这样做是因为struts是根据标签的get 方法取值的你用<bean:write> 取值的时候 还是用time取 这样就获得了date类型的时间了 就能用format