我想用 jsf2.1 和 primefaces 和谷歌应用引擎创建一个应用程序
但是当我测试这个时:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<title>GAE + JSF</title>
</h:head>
<h:body>
<h1>Google App Engine + JSF 2.0 example - hello.xhtml</h1>
<h:form>
<h:inputText value="#{helloBean.name}"></h:inputText>
<p:commandButton value="Welcome Me" actionListener="#{helloBean.tester}" update="dlg"
oncomplete="dlgw.show();" >
<f:setPropertyActionListener value="#{helloBean.name}" target="#{helloBean.nameDialog}" />
</p:commandButton>
<p:dialog id="dlg" widgetvar="dlgw" >
je suis #{helloBean.nameDialog}
</p:dialog>
</h:form>
</h:body>
</html>
当我单击命令按钮并且未启动对话框时,未调用方法“测试器”
我不知道原因
这是托管bean:
package com.esperant;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import java.io.Serializable;
@ManagedBean
@ViewScoped
public class HelloBean implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private String nameDialog;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void tester(){
System.out.println("tester methode");
}
public String getNameDialog() {
return nameDialog;
}
public void setNameDialog(String nameDialog) {
this.nameDialog = nameDialog;
}
}
你对这个问题有什么想法吗
先感谢您