Reset JSF Backing Bean(View or Session Scope)

前端 未结 5 1151
南方客
南方客 2020-12-14 04:36

I want to reset by JSF backing bean when some method is invoked. Assume that there is a command button, someone press it and after succesfull transaction, my View or Session

5条回答
  •  伪装坚强ぢ
    2020-12-14 05:11

    I found the solution for View scope.

        public static void removeViewScopedBean(String beanName) 
        {
          FacesContext.getCurrentInstance().getViewRoot().getViewMap().remove(beanName);
        }
    

提交回复
热议问题