2017-03-08 7 views
-1

SOに関するほとんどすべての関連する質問がありましたが、私は問題がないので答えを見つけることができませんでした。私は同じエラーの結果を持っている他のためのエラーの原因。javax.el.PropertyNotFoundException:クラスに 'プリファレンスプロパティ'がありません。

私は素数のselectBooleanButton要素を実装し、それだけでBeanコードを含んでいます。このエラーは、システムがmanagedBeanのプロパティを読み取ることができないが、ブール値プロパティのために適切なgetter/setterメソッドを持っていることを意味します。以下は参照用のコードです:

ビュー

<html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:p="http://primefaces.org/ui"> 
    <ui:composition template="/templates/common/public.xhtml"> 
    <ui:define name="title">Search</ui:define> 
    <ui:define name="content"> 
     <div class="ui-grid ui-grid-responsive"> 
     <div class="ui-grid-row"> 
      <div class="ui-grid-col-10" id="mainCol"> 
      <h:form id="search"> 
       <h:panelGrid columns="2" cellpadding="5"> 
       <h:outputText value="Choose: " /> 
       <p:selectBooleanButton id="preference" value="#{searchForm.preference}" onLabel="Yes" offLabel="No" style="width:60px" /> 
      </h:form> 
      </div> 
     </div> 
     </div> 
    </ui:define> 
    </ui:composition> 
</html> 

豆:

@ManagedBean 
@SessionScoped 
public class SearchForm { 

    private boolean preference; 

    public boolean isPreference() { 
     return preference; 
    } 

    public void setPreference(boolean preference) { 
     this.preference = preference; 
    } 
} 

エラー:

[glassfish 4.1] [SEVERE] [] [javax.enterprise.resource.webcontainer.jsf.application] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1488954548903] [levelValue: 1000] [[ 
    Error Rendering View[/search/searchForm.xhtml] 
javax.el.PropertyNotFoundException: /search/searchForm.xhtml @49,156 value="#{searchForm.preference}": The class 'com.pc.SearchForm' does not have a readable property 'preference'. 

嘆願提案する。

答えて

0

この質問には長い時間がかかりましたが、原因を述べて問題を解決するだけでこの回答を投稿しました。

グラスフィッシュは変更を取得せず、再起動して問題を解決しました。 あなたの変更について確信があってもエラーが発生した場合は、そのサーバーも疑わしいと思います。

関連する問題