データベースから読み取られたリストを含むアプリケーションスコープのマネージドBeanがあります。別のアプリケーションがデータベースに変更を加えるたびに、Webサービスをトリガーして管理対象Beanのリストを更新する必要があります。
私はもう試した
FacesContext context = FacesContext.getCurrentInstance();
ApplicationBean application= (ApplicationBean) context.getApplication().evaluateExpressionGet(context, "#{applicationBean}", ApplicationBean.class);
おそらくWebサービスがJSFコンテキストで呼び出されていないため、コンテキスト変数がnullでした。
RESTリソースクラスは次のようになります。
@Path("/application")
public class ApplicationResource {
@PUT
@Path("{id}")
@Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.TEXT_PLAIN)
public void updateIdCache(@PathParam("id") String internalid) {
ApplicationBean application = ???;
application.update(id);
return;
}
}
使用中のアプリケーションサーバーはtomcat6です。どのように正しく実行されますか?
感謝をこめて