Java Reference
In-Depth Information
TypeConverterFactory.Class
This is the implementation of the TypeConverterFactory interface. The
default is DefaultTypeConverterFactory . A custom type converter factory
lets you control how TypeConverter instances are created and also allows
you to register custom type converters outside of the extension pack-
ages. For example:
<init-param>
<param-name> TypeConverterFactory.Class </param-name>
<param-value> stripesbook.nonext.MyTypeConverterFactory </param-value>
</init-param>
package stripesbook.nonext;
public class MyTypeConverterFactory
extends DefaultTypeConverterFactory
{
@Override
public void init(Configuration config) {
super .init(config);
add(MyType. class , MyTypeConverter. class );
}
@Override
public TypeConverter getTypeConverter(Class forType, Locale locale)
throws Exception
{
TypeConverter tc = super .getTypeConverter(forType, locale);
ServletContext context =
StripesFilter.getConfiguration().getServletContext();
SpringHelper.injectBeans(tc, context);
return tc;
}
}
ValidationMetadataProvider.Class
This is the implementation of the ValidationMetadataProvider interface,
which is responsible for returning ValidationMetadata for properties and
nested properties of an action bean. The default is DefaultValidationMeta-
dataProvider . Here's an example:
<init-param>
<param-name> ValidationMetadataProvider.Class </param-name>
<param-value>
stripesbook.nonext.MyValidationMetadataProvider
</param-value>
</init-param>
 
 
Search WWH ::




Custom Search