NotSerializableException for UIComponents

Sometimes I am getting ‘bugs’ that claim there is something wrong with the (Trinidad) framework, as its UIComponents are NOT serializable… An example:

No, this is not a bug at all!

Your (session/application/pageFlow scoped) backing beans should not have an UI component as its property… (if you really really need the “cool” binding attribute).

UIComponents are not serializable – for a good reason!
In JSF there is StateSaving (see the restore/saveState() hooks)….

Apache MyFaces Trinidad does have a tool that helps to store an reference to an UIComponent (instead of the component itself).

Here are a few blogs on that, that may give more information on the API and why the tool is there:

Have fun!


Posted in apache, java, jsf, myfaces, trinidad

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: