How to use Ajax with JSF 2.0?

后端 未结 4 1282
名媛妹妹
名媛妹妹 2020-12-22 05:41

I want to implement Ajax on my JSF web project. I googled and found that ICEFaces is supporting Ajax with JSF. Yet I dont know the usability of it.

Any one has exper

4条回答
  •  难免孤独
    2020-12-22 05:47

    It is quite simple and elegant to use Ajax in JSF but you should not abuse because of debugging constraints.

    HTML page Fragment :

     
        
        
     
    

    Backing bean fragment :

    public boolean handleTabChange() {
        ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
        String index = externalContext.getRequestParameterMap().get("tabIndex");
        setTabIndex(Integer.parseInt(index));
        return true;
    }
    

提交回复
热议问题