问题
I have to implement a Proof of concept for multi client handling in JSF 2.0. How can multiple clients be handled in jsf?
回答1:
Just do not store request or session scoped data in a managed bean which is placed in the application scope. Also just do not declare the properties of a request or session scoped bean which is supposed to live as long as the bean itself as static.
It's under the hoods not different from the basic Servlet API.
回答2:
JSF 2.0 helps you to provide a way to create user interfaces and has some built-in annotations for handle scopes like request, session or application. In simple scenarios use request, view, flash and session scope could work for you. But if you need something more elaborated take a look at MyFaces Orchestra which provide the well known conversation scope (requires spring) or even better take a look at MyFaces CODI, which provide you things like bean validation, scripting, window scope, and much more!. Use CODI is the best for new JSF web applications, because follows the standard for CDI - JSR 299, and provide you some useful goodies.
The best way to start with CODI is look on MyFaces CODI Wiki and you can also ask question on MyFaces Users and Dev Mailing lists.
来源:https://stackoverflow.com/questions/6482033/proof-of-concept-for-multiple-clients-in-jsf-2-0