Dienstag, 5. Oktober 2010

Porting @ViewScoped JSF Annotation to CDI to use it with Primefaces

Primefaces

Today I spent several hours to use the right scope with Primefaces and CDI/Weld. Finally I found this cool
blog of Steven Verborgh
which describes how to create a view scope for CDI.

With this scope a backing bean keeps alive as long as the user stays on the same page/view.

1 Kommentar:

  1. I'd recommend using MyFaces CODI project. It (by default) enables the ViewScope to be supported in CDI.

    In addition it contains more useful scopes (better @ConversationScoped, @WindowScoped, ...)

    See:
    http://github.com/matzew/codi-scope-sample

    and:
    https://cwiki.apache.org/confluence/display/EXTCDI/Documentation

    (check out the child pages)

    AntwortenLöschen