PrimeFaces组件的自定义渲染器在Tomcat中可以正常工作,但在Websphere中不能正常工作

编程入门 行业动态 更新时间:2024-10-11 03:16:45
本文介绍了PrimeFaces组件的自定义渲染器在Tomcat中可以正常工作,但在Websphere中不能正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用MyFaces 2.1.9和PrimeFaces 3.5.我已经为<p:inputText>实现了自定义渲染器.这在Tomcat上可以正常使用.但这不适用于Websphere.我已经在自定义渲染器类中放置了断点,但是它们从未被击中.我在日志中也看不到任何内容.但是,当我在标准JSF <h:inputText>上注册完全相同的自定义渲染器时,它就可以正常工作.

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.

我已经在faces-config.xml中将其注册如下:

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

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

如何解决自定义渲染器的注册问题?

How can I troubleshoot the registration of the custom renderer?

推荐答案

需要覆盖第三方组件库的渲染器的自定义渲染器需要在webapp自己的faces-config.xml中注册,而不是在打包在其中的faces-config.xml中注册/WEB-INF/lib中的另一个JAR. JAR文件的加载顺序未指定,因此可能会在您要覆盖的第三方组件库之一的之前加载并注册自定义渲染器,就像您面对的一样

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.

更多推荐

PrimeFaces组件的自定义渲染器在Tomcat中可以正常工作,但在Websphere中不能正常工作

本文发布于:2023-11-25 18:11:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630802.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:工作   但在   自定义   不能正常   组件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!