Why should I use createComponent instead of creating the instance myself?
问题 This is more of a conceptual question. I had to work on a functionality that had to create a dynamic h:dataTable . And whenever I created a component, I did something similar to this: DataTable table = (DataTable) FacesContext.getCurrentInstance().getApplication() .createComponent(DataTable.COMPONENT_TYPE); Using the FacesContext to create everything for me. However I could just as simply have done this: DataTable table = new DataTable(); The reason I did it in the first way is that all the