What are the main disadvantages of Java Server Faces 2.0?

前端 未结 13 2221
猫巷女王i
猫巷女王i 2020-11-22 06:29

Yesterday I saw a presentation on Java Server Faces 2.0 which looked truly impressive, even though I am currently a happy ASP.NET MVC / jQuery developer. What I liked most a

13条回答
  •  伪装坚强ぢ
    2020-11-22 06:53

    We developed a sample project with JSF (It was a three week research so we may have lose some things!)

    We try to use core jsf, if a component is needed we used PrimeFaces.

    The project was a web site with navigation. Each page should be loaded via ajax when the menu is clicked.

    The site has two usecases:

    1. A page with a grid. The grid is loaded via ajax and should support sort and paging
    2. A three step wizard page. Each page has client side validation (for simple validations) and server side ajax base validation (for complex validations). Any server exception ( from service layer) should be displayed on the same page of wizard without navigating to next page.

    We found that:

    1. You need to use some hacks from omniFaces to make the JSF view state fixed. The JSF state will be corrupted when you include pages via ajax in each other. This seems a bug in JSF and may be fixed on next releases (not in 2.3).
    2. The JSF Flow is not working correctly with ajax (or we could not make it work!) We try to use primeface wizard component instead but the client validation seems not supported and mean while it was not standard JSF flow standard.
    3. When using some jQuery components like jqGird, and you need to load JSON results, then you are advised to use pure servlet, The JSF will do nothing for you. So if you use these kind of components, your design will not fit in JSF.
    4. We try to do some client scripts when ajax complete by ajaxComplete and we found that the PF 4 has implemented its own ajax events. We had some jQuery components and we need to change their code.

    If you change the above sample to a non Ajax project ( or at least less ajax project) you will not face lots of above issues.

    We summarize our research as:

    JSF is not working well in an fully ajax base website.

    Of course we find lots of nice features in JSF which may be very helpful in some projects, so consider your project needs.

    Please refer to JSF technical documents to review JSF advantages, and in my opinion the biggest advantage of JSF, is the COMPLETE AND HUGE support from @BalusC ;-)

提交回复
热议问题