JSF 2.0: StateHolder vs. Serializable?
JSF has a special state-saving code that expects objects to implement StateHolder
apart from the common Serializable
approach. However, I just had a开发者_运维知识库 look at AjaxBehaviorListenerImpl
class bundled with Mojarra 2.0.2. Instead using StateHolder
, it is simply implementing Serializable
and this works ok.
The thread at http://old.nabble.com/Serializable-UIcomponents-td19471884.html seems to state that going with Serializable
should be avoided, but what are the detailed rules with this? It seems that, when object doesn't have any children (to notify of state changes), implementing Serializable is ok.
When is it ok to use Serializable
and when not? It takes less code with Serializable
as it is automated...
精彩评论