Custom renderer for PrimeFaces component works fine in Tomcat, but not in Websphere

爷,独闯天下 提交于 2020-01-14 09:28:28

问题


I'm using MyFaces 2.1.9 and PrimeFaces 3.5. I've implemented a custom renderer for <p:inputText>. This works fine at home with Tomcat. But this does not work at work with Websphere. I've placed breakpoints in the custom renderer class, but they are never hit. I see nothing in my logs as well. However, when I register the very same custom renderer on standard JSF <h:inputText>, then it works fine.

I've registered it as follows in faces-config.xml:

<render-kit>
    <renderer>
        <component-family>org.primefaces.component</component-family>
        <renderer-type>org.primefaces.component.InputTextRenderer</renderer-type>
        <renderer-class>xxx.xxx.xxx.MyInputRenderer</renderer-class>
    </renderer>
</render-kit>

How can I troubleshoot the registration of the custom renderer?


回答1:


Custom renderers which needs to override renderers of 3rd party component libraries needs to be registered in webapp's own faces-config.xml, not in a faces-config.xml which is packed in another JAR in /WEB-INF/lib as well. The loading order of JAR files is unspecified, so it may happen that the custom renderer is loaded and registered before the one of the 3rd party component library which you'd like to override, exactly like as you faced.



来源:https://stackoverflow.com/questions/15919624/custom-renderer-for-primefaces-component-works-fine-in-tomcat-but-not-in-websph

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