Reset JSF Backing Bean(View or Session Scope)

前端 未结 5 1178
南方客
南方客 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 04:57

    I solve the problem with code like this:

    ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()).getSession().removeAttribute("bean name");            
    

    By this way I enter to session scoped bean and reset it without the data that was there before

提交回复
热议问题