Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/403.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 是否可以覆盖richfaces标记的实现?_Java_Jsf_Richfaces - Fatal编程技术网

Java 是否可以覆盖richfaces标记的实现?

Java 是否可以覆盖richfaces标记的实现?,java,jsf,richfaces,Java,Jsf,Richfaces,例如,rich:dataScroller具有以下实现类: <component-type>org.richfaces.DataScroller</component-type> <component-class>org.richfaces.component.UIDataScroller</component-class> <cdk:handler-class>org.richfaces.taglib.DataScrollerHandl

例如,rich:dataScroller具有以下实现类:

<component-type>org.richfaces.DataScroller</component-type>
<component-class>org.richfaces.component.UIDataScroller</component-class>
<cdk:handler-class>org.richfaces.taglib.DataScrollerHandler</cdk:handler-class>
<cdk:renderer-type>org.richfaces.DataScrollerRenderer</cdk:renderer-type>
Richfaces 4.2.2
jsf 2.1.7

您可以在应用程序的faces-config.xml中更改组件定义,例如

<component>
    <component-type>org.richfaces.DataScroller</component-type>
    <component-class>com.example.myNewScroller</component-class>
</component>

org.richfaces.DataScroller
com.example.mynewscoller

解决方案适用于组件类。对于渲染器,可以使用以下配置:

    <render-kit>
    <renderer>
        <component-family>org.richfaces.DataScroller</component-family>
        <renderer-type>org.richfaces.DataScrollerRenderer</renderer-type>
        <renderer-class>com.agentes.rfa.richfaces.RfaDataScrollerRenderer</renderer-class>
    </renderer>
    </render-kit>

org.richfaces.DataScroller
org.richfaces.datascrollerender
com.agents.rfa.richfaces.rfadatascrollerender

我仍然没有找到覆盖处理程序类的好方法。可能是这样的

“是否可以在不定义新的自定义标记的情况下覆盖这些类?”是的,您可以。。。尝试您似乎已经知道在何处进行更改……是否有方法以类似的方式重写处理程序和呈现程序类?
    <render-kit>
    <renderer>
        <component-family>org.richfaces.DataScroller</component-family>
        <renderer-type>org.richfaces.DataScrollerRenderer</renderer-type>
        <renderer-class>com.agentes.rfa.richfaces.RfaDataScrollerRenderer</renderer-class>
    </renderer>
    </render-kit>