背景:Primefaces 2.2.1マッピング/ロケ春管理Beanと3.0.1のアップグレード問題に
私はPrimefaces Webアプリケーションでは、二つのクラス(Search.javaとSearchBean.java)以下の使用しています(バージョン2.2.1)。 com.actions
パッケージのすべてのクラスは、アプリケーション(actionListeners、Listenersなど)のビジネスロジックを処理するリクエストスコープBeanです。 com.beans
パッケージ内のクラスは、アプリケーションについての状態を維持するすべてのセッションスコープBeanです。スコープされた各要求には、CDIを使用して注入されたセッションスコープBeanのインスタンスがあり、それぞれがSpringによって管理されます。
問題:私はクラスを3.0.1にアップグレードする場合
がPrimefacesによって登録取得されていないと私はタイプcom.actions.Searchに見つからないプロパティ「テスト」のようなエラーメッセージが表示されます。これは、Primefacesコンポーネントから以下のリクエストまたはセッションBeanのいずれかにマップされるすべての単一のメソッドで発生します。適切な変更は何ですか?
例外:ビジネス・ロジックを処理し、セッションのインスタンスがBeanスコープ保持
javax.el.ELException: /WEB-INF/facelet/components/test.xhtml: Property 'process' not found on type com.actions.Search
com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:94)
com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:853)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:115)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
com.dc.api.service.impl.CacheControlFilter.doFilter(CacheControlFilter.java:31)
com.dc.api.service.impl.HttpsCookieFilter.doFilter(HttpsCookieFilter.java:46)
クラスセッション状態でデータを保持
package com.actions;
import javax.inject.Inject;
import javax.inject.Named;
import org.springframework.context.annotation.Scope;
import com.beans.SearchBean;
@Named
@Scope("request")
public class Search{
@Inject
private SearchBean searchBean;
public void process() {
//business logic here
searchBean.get...
}
}
豆
package com.beans;
import javax.inject.Named;
import org.springframework.context.annotation.Scope;
@Named
@Scope("session")
public class SearchBean {
private String text="test";
//getters and setters
}
以下の代替アプローチもまたnそれから変わっていたように、p =「http://primefaces.org/ui」:(一つだけ豆を使用して)OT作業:
package com.actions;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component
@Scope("session")
public class Search {
public void sessionIdleListener() {
}
}
あなたはJava Beanプロパティのgetter/setterを正しく守っていることを確認できますか?@ [link] http://stackoverflow.com/questions/8577545/javax-el-propertynotfoundexception-property-answer-not-found-on-type-com-pool) –
@gbagga - そうです。私が変更したのはPrimefaceのバージョンでした。 – c12
primefaceから現在使用されているタグの違いを確認できますか?バージョン2では存在しますがバージョン3では存在しないタグのプロパティ –