Override default converter in JSF

孤街浪徒 提交于 2019-12-24 18:23:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!