Migrating JSF 1.1 with Ajax4jsf 1.x to JSF 2

前端 未结 1 1946
囚心锁ツ
囚心锁ツ 2020-12-03 16:06

We are migrating JSF 1.1 (MyFaces) project to JSF 2. The idea is to migrate periodically by keeping both JSP and XHTML together for some time. We use many ajax4jsf-1.1.1 tag

1条回答
  •  难免孤独
    2020-12-03 16:25

    Get rid of Ajax4jsf 1.x altogether. It's indeed not compatible with JSF2. Instead, JSF2 offers a new main ajax tag which covers all the core functionality as previously offered by Ajax4jsf 1.x.

    If upgrading to RichFaces 4 is not an option (because, as you said yourself, you aren't using RichFaces components anywhere), then just remove Ajax4jsf 1.x and replace all tags by standard JSF2 equivalents.

    • : use .
    • : just put managed bean in the view scope by @ViewScoped.
    • : use jsf.ajax.addOnEvent() or jsf.ajax.addOnError() in JS context.
    • : just nest inside .
    • : use and remember to include its ID in or PrimeFaces .
    • : just use standard .
    • : just use , it will autorecognize .
    • : just nest inside .
    • : no replacement. Consider OmniFaces or PrimeFaces .
    • : just use , you can even wrap around a group of components.
    • : just use standard .
    • : use jsf.ajax.addOnEvent() or jsf.ajax.addOnError() in JS context.
    • : just use standard .
    • : just use standard .
    • : no replacement. Consider PrimeFaces .
    • : no replacement. Consider OmniFaces or PrimeFaces .
    • : just nest inside .
    • : just use standard .
    • : just use standard .
    • : just use standard .

    You also need to rename/rewrite JSP files to Facelets files. In simple cases, this is usually just a matter of changing root declarations and file extensions. Facelets makes it easier to replace all duplicated code by a single template. The following answer applies:

    • Migrating from JSF 1.2 to JSF 2.0

    0 讨论(0)
提交回复
热议问题