On JSF 2.2
we don't have the option to set the View Scope
on faces-config.xml
.
So how should it be done? Is the view scope missing on JSF 2.2 ?
Thank you!
On JSF 2.2
we don't have the option to set the View Scope
on faces-config.xml
.
So how should it be done? Is the view scope missing on JSF 2.2 ?
Thank you!
Use
@ViewScoped
annotation on managed bean:If you don't like the annotations configuration (really odd), you can just set the view scope on faces-config.xml
Note that this only works on JSF 2. Check that your faces-config file is configured to handle JSF 2.x version:
Note: Warning make sure its Serializable
The error message is pretty straightforward:
This means that your
com.bean.StatusBean2
must also implement theSerializable
interface. Fromjava.io.Serializable
documentation:You can learn more about Java Serialization here: Java Serialization
From your question: is it necessary to implement serializable?, BalusC already posted a good answer/explanation: JSF backing bean should be serializable? Thanks for @Luiggi Mendoza