> Hello,
> how can i overwrite a TypeConverter for a Map?
>  
> I defined the following global TypeConverter:
> java.lang.String=de.xxxx.converter.StringTrimConverter
> (the converter removes blanks from the string)
>  
> This converter is used for every String, even inside maps. That's fine.
>  
> In one action i use the following map:
> Map<String, String> textfield = ...
> How can i use the default/another String converter for this property?
> Using a properties file for the action doesn't work. The Entry 
> "Element_textfield" is not used because i use Generics.
>  
> Thanks
> Andreas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 



You can annotate the setter for that field, e.g.:


@TypeConversion(converter = "my.package.TextfieldConverter")
public void setTextfield(Map<String, String> textfield)


and of course you have to implement your own converter:

public class TextfieldConverter extends StrutsTypeConverter


regards,
Christoph

This Email was scanned by Sophos Anti Virus

Reply via email to