0

我有一些 myfaces codi 的例子,但没有一个显示耳朵的结构。还有我如何@closeConversationGroup在耳朵项目中使用,因为注释的拦截没有被拾取。

以下是代码的外观:

<h:form>
        <h:commandButton action="#{userBeanMyFaces.startMe()}" value="Increment String" id="beginid"/>
        <h:commandButton action="#{userBeanMyFaces.endConversationGroup()}" value="END Conversation GROUP" id="end1"/>
        <h:commandButton action="#{userBeanMyFaces.toDifferentPage()}" value="To a different page" id="differentpage"/>
    </h:form>

这是java代码:

@Inject
private Conversation conversation;

@Inject
private WindowContext windowContext;

@Produces @Named
private String testString = "string1";

public void startMe() {
    testString = testString + "string2";
}

public String toDifferentPage() {
    return "ok";
}

@CloseConversationGroup(group=ConversationGroup1.class)
public void endConversationGroup() {
    System.out.println("END ACTION HAPENNING");
}

这是第2页代码:

<h:form>
        <h:outputText value="#{testString}" />
        <h:commandButton action="#{userBeanMyFaces.startMe()}" value="Increment String" id="increment"/>
        <h:commandButton action="#{userBeanMyFaces.toDifferentPage()}" value="go to first page" id="changepage"/>
    </h:form>

而且我的 closeconversation 组不起作用,注释@CloseConversationGroup(group=ConversationGroup1.class)根本不起作用,我可以看到 中有拦截器myfaces-extcdi-jsf20-module-impl,但它没有被激活。只有当我自己复制 annocations 时它才会激活bean.xml。关于发生了什么的任何想法?

提前致谢

谢谢

4

0 回答 0