我有以下构造:
@Named
public class SpecificAction extends BasicAction {
public void calulateSomething(ValueChangeEvent event) {...}
}
}
@Named
public abstract class BasicAction {
public void calculateSomething(ValueChangeEvent event) {...}
}
比意见:
文件:SpecificAction.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:cc="http://java.sun.com/jsf/composite/cc"
xml:lang="de" lang="de">
<ui:composition template="/BasicAction.xhtml">
<ui:param name="basicAction" value="#{specificAction}" />
....
</ui:composition>
BasicAction.xhtml 包含我的复合组件:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:cc="http://java.sun.com/jsf/composite/cc"
xmlns:gui="http://java.sun.com/jsf/composite/gui">
<gui:inplaceInput id="name" valueChangeListener="#{basicAction.calculateSomething}" value=#{bean.name} />
</html>
和复合组件:
<composite:interface>
<composite:attribute name="value" />
<composite:editableValueHolder name="Value"/>
<composite:attribute name="valueChangeListener" targets="Value" />
</composite:interface>
<composite:implementation>
<h:inputText id="Value" value="#{cc.attrs.value}" onblur="handleBlur(this.id);" >
<composite:insertChildren />
</h:inputText>
</composite:implementation>
如果我运行我的创建,如果 valueChangeListener 的 el 是“specificAction”,它会完美运行。它在带有“basicAction”表达式的basicAction.xhml中也可以正常工作,只是使用复合组件我得到了那个有趣的异常:
[ExceptionHandlerFactory] Handling exception javax.faces.event.AbortProcessingException: javax.faces.event.AbortProcessingException: /BasicAction.xhtml @XX,XX valueChangeListener="#{basicAction.calculateSomething}": The class 'SpecificAction' does not have the property 'calculateSomething'.
at javax.faces.event.MethodExpressionValueChangeListener.processValueChange(MethodExpressionValueChangeListener.java:157) [:2.1.3-FCS]
at javax.faces.event.ValueChangeEvent.processListener(ValueChangeEvent.java:134) [:2.1.3-FCS]
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769) [:2.1.3-FCS]
任何想法,那可能是什么黑客?
Seam 3 或 JSF2 框架中的错误或我这边的一些愚蠢的错误?