当前位置: 首页 > 知识库问答 >
问题:

Jsf PrimeFaces。呈现响应期间出错。P:CommandButton

狄望
2023-03-14

我开始在一个Hibernate项目上使用JSF和primefaces库。我尝试使用向导组件来管理表单,但是当我单击向导中的任何按钮时,我得到以下警告,并且操作侦听器没有被调用

9-ott-2012 9.50.43 org.apache.myfaces.trinidadinternal.context.PartialViewContextImpl getPartialResponseWriter
AVVERTENZA: getPartialResponseWriter() called during render_reponse. The returned writer is not integrated with PPRResponseWriter
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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">

<h:head>

<h:outputScript name="jsf.js" library="javax.faces" target="head" />
</h:head>

<h:body>



    <p:growl id="growl" showDetail="true" sticky="true" />

    <h:form>

    <p:wizard widgetVar="wiz"  
        flowListener="#{traduttoreBean.onFlowProcess}"> 

        <p:tab id="personali" title="Info Personali">  

        <p:panel header="Informazioni Personali">  

            <h:messages errorClass="error"/>  

            <h:panelGrid columns="2" columnClasses="label, value" styleClass="grid">  
                <h:outputText value="Nome: *" />  
                <p:inputText required="true" label="Nome"  
                        value="#{traduttoreBean.info.nome}" />  

                <h:outputText value="Cognome: *" />  
                <p:inputText required="true" label="cognome"  
                        value="#{traduttoreBean.info.cognome}" />

            </h:panelGrid>  

        </p:panel>  
    </p:tab>


    <p:tab id="confirm" title="Confirmation">  
        <p:panel header="Confirmation">  

            <h:panelGrid id="confirmation" columns="6">  
                <h:outputText value="Nome: " />  
                <h:outputText styleClass="outputLabel"  
                            value="#{traduttoreBean.info.nome}" />  

                <h:outputText value="Cognome: " />  
                <h:outputText  styleClass="outputLabel"  
                            value="#{traduttoreBean.info.cognome}" />  


                <h:outputText />  
            </h:panelGrid>  

           <p:commandButton value="Submit" update="growl" action="#{traduttoreBean.save}" ></p:commandButton> 

        </p:panel>  
    </p:tab>  

    </p:wizard> 
      </h:form> 

</h:body>
</html>
public class TraduttoreBean implements Serializable{

/**
 * 
 */
private static final long serialVersionUID = 1L;


private Traduttore traduttore;
private InfoTraduttore info;

public TraduttoreBean(){

    this.traduttore=new Traduttore();
    this.info= new InfoTraduttore();
    this.info.setTraduttore(traduttore);

}

public void save(ActionEvent actionEvent) {  

    PersistenzaUtenti pu= PersistenzaUtenti.getInstance();
    PersistenzaInfoTraduttori pi= PersistenzaInfoTraduttori.getInstance();

    try {
        pu.insert(traduttore);
        pi.insert(info);
    } catch (Exception e) {

    }

    FacesMessage msg = new FacesMessage("Successful", "Welcome :" + info.getNome());  
    FacesContext.getCurrentInstance().addMessage(null, msg);  

}  


public String onFlowProcess(FlowEvent event) {  

        return event.getNewStep();  

} 



public Traduttore getTraduttore() {
    return traduttore;
}

public void setTraduttore(Traduttore traduttore) {
    this.traduttore = traduttore;
}

public InfoTraduttore getInfo() {
    return info;
}

public void setInfo(InfoTraduttore info) {
    this.info = info;
}

}
<managed-bean>
    <managed-bean-name>traduttoreBean</managed-bean-name>
    <managed-bean-class>guiBeans.TraduttoreBean</managed-bean-class>
    <managed-bean-scope>view</managed-bean-scope>
</managed-bean>

共有1个答案

齐甫
2023-03-14

评论提供的答案:

问题是特立尼达图书馆与Primefaces有冲突。已解决删除特立尼达库的问题。

 类似资料: