Java 是否可以覆盖richfaces标记的实现?
例如,rich:dataScroller具有以下实现类: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
<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>