In that case you must use own converter like this:

public class DateTimeConverter extends StrutsTypeConverter {

     @Override
public Object convertFromString(Map context, String[] values, Class toClass) {
          try {
return DateUtil.getConvertedDate(values[0], DateUtil.DATE_TIME);
          } catch (TypeConversionException tce) {
               log.error("Exception while parsing date.", tce);
          }
          return null;
     }
}

Method getConvertedDate() just parse inserted date as string by user.

Reeshi Agrawal wrote on 28.7.2010 15:05:
Michal,
I wanted the user to input his birth-date. Displaying the current date will
be of no use for it.

Reply via email to