Wiki on how to add Converter and Formatter classes is wrong

Description

The Wiki says to add Type Converter and Formatter classes one adds the following to web.xml:

<init-param>
<param-name>Extension.Packages</param-name>
<param-value>
path.to.LocalDateTimeConverter,
path.to.LocalDateTimeFormatter,
</param-value>
</init-param>

This never worked (as far back as 1.4). The correct way is to do the following:
(1) in web.xml

<init-param>
<param-name>TypeConverterFactory.Class</param-name>
<param-value>path.to.TypeConverterFactory</param-value>
</init-param>
<init-param>
<param-name>FormatterFactory.Class</param-name>
<param-value>path.to.FormatterFactory</param-value>
</init-param>

(2)
public class TypeConverterFactory extends DefaultTypeConverterFactory
{
public TypeConverterFactory() {
super();
}

public void init(Configuration configuration) {
super.add(LocalDateTime.class, LocalDateTimeTypeConverter.class);
}
}

3)
public class FormatterFactory extends DefaultFormatterFactory {
public Formatter<?> getFormatter(Class<?> clazz, Locale locale, String formatType, String formatPattern) {
if (clazz == LocalDateTime.class)
return new LocalDateTimeFormatter();
else
return super.getFormatter(clazz, locale, formatType, formatPattern);
}
public void init(Configuration configuration) { }
}

4)
public class LocalDateTimeTypeConverter implements TypeConverter<LocalDateTime>
{
@Override
public LocalDateTime convert(String input, Class<? extends LocalDateTime> type,
Collection<ValidationError> errors) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return LocalDateTime.parse(input, formatter);
}

@Override
public void setLocale(Locale arg0) {}
}

5)
public class LocalDateTimeFormatter implements Formatter<LocalDateTime> {
public String format(LocalDateTime date) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return date.format(formatter);
}
public void init() { }

public void setFormatPattern(String pattern) { }

public void setFormatType(String arg0) { }

public void setLocale(Locale arg0) { }
}

Environment

None

Status

Assignee

Unassigned

Reporter

CN Yee

Labels

None

Tester

None

Components

Affects versions

Release 1.5.8
Release 1.6

Priority

Minor
Configure