问题
Is it possible to override the default converter of JSF with a custom converter. For instance what will happen if I register a custom converter with CONVERTER_ID="javax.faces.Enum"
in faces-config.xml. Would JSF pick custom converter or would it still use the in-built EnumConverter?
Kaushal
回答1:
You can define your custom converter and use it in JSF components that you would like to override the default one: http://www.mkyong.com/jsf2/custom-converter-in-jsf-2-0/
If you want to definitely use your new one instead of a defined one. You can define the new one with the same name and package of the one you wish to override, so your server will load your class instead of the one defined in JSF jars
来源:https://stackoverflow.com/questions/15311664/override-default-converter-in-jsf