2017-06-23 3 views
-2

私のアプリケーションがライトのManagedBeanからではなくプロパティを取得している理由を理解できません。プロパティ [idCurrentSousSysteme]タイプ には見られない[fr.tecup.htsm.ihm.EvenementRedouteView]:37116 ターゲット= "#{} sousSystemeView.idCurrentSousSysteme" @間違ったManagedBeanからプロパティを探す

Systeme.xhtml:私は次のエラーを取得します

javax.servlet.ServletException:/utilisateur/Systeme.xhtml 37116 ターゲット= "#{sousSystemeView.idCurrentSousSysteme}" @:不動産 は[idCurrentSousSysteme]タイプ に見つかりません[fr.tecup.htsm.ihm.EvenementRedouteView ]

誰かが間違いについて考えているなら、それはすばらしいでしょう! ありがとうございます。ここで

は私のコードは次のとおりです。

SousSystemeView

@ManagedBean(name="sousSystemeView") @SessionScoped 
public class SousSystemeView { 

private final String link = "SousSysteme.jsf"; 
private SousSysteme currentSousSysteme = null; 
private int idCurrentSousSysteme = -1; 

public SousSysteme getCurrentSousSysteme() { 
    return currentSousSysteme; 
} 

public void setCurrentSousSysteme(SousSysteme currentSousSysteme) { 
    this.currentSousSysteme = currentSousSysteme; 
} 

public void loadSousSysteme(int idSousSysteme) { 
    SousSysteme sousSysteme = SousSystemeDAO.loadSousSystemeById(idSousSysteme); 
    setCurrentSousSysteme(sousSysteme); 
} 

public void setIdCurrentSousSysteme (int idCurrentSousSysteme) { 
    this.idCurrentSousSysteme = idCurrentSousSysteme; 
} 

public void loadSousSystemePage() { 
    loadSousSysteme(idCurrentSousSysteme); 

    ExternalContext context = FacesContext.getCurrentInstance().getExternalContext(); 
    try { 
     context.redirect(link); 
    } catch (IOException e) { 
    } 
} 
} 

EvenementRedouteView

@ManagedBean(name="evenementRedouteView") @SessionScoped 
public class EvenementRedouteView { 

private final String link = "EvenementRedoute.jsf"; 
private EvenementRedoute currentEvenementRedoute = null; 

public EvenementRedoute getCurrentEvenementRedoute() { 
    return currentEvenementRedoute; 
} 

public void setCurrentEvenementRedoute(EvenementRedoute currentEvenementRedoute) { 
    this.currentEvenementRedoute = currentEvenementRedoute; 
} 

public void loadEvenementRedoute(int idEvenementRedoute) { 
    EvenementRedoute er = EvenementRedouteDAO.loadEvenementRedouteById(idEvenementRedoute); 
    setCurrentEvenementRedoute(er); 
} 

public void loadEvenementRedoutePage(int idEvenementRedoute) { 
    loadEvenementRedoute(idEvenementRedoute); 

    ExternalContext context = FacesContext.getCurrentInstance().getExternalContext(); 
    try { 
     context.redirect(link); 
    } catch (IOException e) { 
    } 
} 
} 

Systeme.xhtml

<?xml version="1.0" encoding="ISO-8859-1"?> 
 
<!DOCTYPE html> 
 
<html xmlns:f="http://java.sun.com/jsf/core" 
 
\t xmlns:h="http://java.sun.com/jsf/html" 
 
\t xmlns:p="http://primefaces.org/ui"> 
 
<f:view> 
 
\t <f:loadBundle basename="systeme" var="systemeProps"></f:loadBundle> 
 
\t <h:head> 
 
\t \t <title>#{systemeProps.title}</title> 
 
\t </h:head> 
 
\t <h:body> 
 
\t \t <h:outputStylesheet name="css/style.css" /> 
 
\t \t <h:outputStylesheet name="css/styleSysteme.css" /> 
 
\t \t <header id="banniere"> 
 
\t \t \t <h2>Hazards Tracking System Manager</h2> 
 
\t \t </header> 
 
\t \t <p:breadCrumb styleClass="path"> 
 
\t \t \t <p:menuitem icon="fa fa-home" url="/utilisateur/index.jsf" /> 
 
\t \t </p:breadCrumb> 
 
\t \t <div class="ui-g GridCSS"> 
 
\t \t \t <div class="ui-g-1"></div> 
 
\t \t \t <p:panelGrid columns="1" styleClass="ui-g-10 panelGridSysteme"> 
 
\t \t \t \t <f:facet name="header">#{systemeView.currentSysteme.code}</f:facet> 
 
\t \t \t \t <p:panelGrid columns="2" styleClass="panelGridSystemeInfos"> 
 
\t \t \t \t \t <h:outputText value="#{systemeProps.name}" styleClass="panelGridSystemeInfosHeader" /> 
 
\t \t \t \t \t <h:outputText value="#{systemeView.currentSysteme.nom}" /> 
 

 
\t \t \t \t \t <h:outputText value="#{systemeProps.comment}" styleClass="panelGridSystemeInfosHeader" /> 
 
\t \t \t \t \t <h:outputText value="#{systemeView.currentSysteme.commentaire}" /> 
 
\t \t \t \t </p:panelGrid> 
 
\t \t \t \t <h:form> 
 
\t \t \t \t \t <p:dataGrid var="sousSysteme" value="#{systemeView.currentSysteme.sousSystemes}" columns="3" layout="grid" rows="12" paginator="false" styleClass="dataGridSousSystemes"> 
 
\t \t \t \t \t \t <f:facet name="header">#{systemeProps.subSystems}</f:facet> 
 
\t \t \t \t \t \t <p:panel style="text-align:center"> 
 
\t \t \t \t \t \t \t <p:panelGrid columns="1" columnClasses="label,value" layout="grid"> 
 
\t \t \t \t \t \t \t \t <p:commandLink value="#{sousSysteme.code}" action="#{sousSystemeView.loadSousSystemePage}" ajax="false"> 
 
\t \t \t \t \t \t \t \t \t <f:setPropertyActionListener target="#{sousSystemeView.idCurrentSousSysteme}" value="#{sousSysteme.id}" /> 
 
\t \t \t \t \t \t \t \t </p:commandLink> 
 
\t \t \t \t \t \t \t \t <h:outputText value="#{sousSysteme.nom}" /> 
 
\t \t \t \t \t \t \t </p:panelGrid> 
 
\t \t \t \t \t \t </p:panel> 
 
\t \t \t \t \t </p:dataGrid> 
 
\t \t \t \t </h:form> 
 
\t \t \t </p:panelGrid> 
 
\t \t </div> 
 
\t </h:body> 
 
</f:view> 
 
</html>

+0

Welcome to StackOverflow! [最小限で完全で検証可能な例]を作成してみてください(https://stackoverflow.com/help/mcve) – SilverNak

答えて

0

私は何が起こっているのかを考え出したと思います。私は理由はわかりませんが、ファイルEvenementRedouteView.classは再構築されていません。私はカットアンドペーストでそれを作成し、ManagedBeanの注釈名は "souSystemeView"でした...

関連する問題