File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes NotSerializableException + jsf custom components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "NotSerializableException + jsf custom components" Watch "NotSerializableException + jsf custom components" New topic

NotSerializableException + jsf custom components

Anthony Taylor

Joined: May 04, 2006
Posts: 26
I seem to receive a NotSerializableException whenever I try to make a request to a jsf page I recently developed. I began to notice this problem when I changed the STATE_SAVING_METHOD to client in the web.xml file. The exception seems to be pointing to a textbox custom component we developed. Do custom components need to implement Serializable? Maybe I am confused about how storing information on the client occurs, but if someone could shed some light on what could be going on here, it would be greatly appreciated?
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
When setting the state saving to client, then all objects have to be serialized before being saved into the rendered HTML page. And yes, your custom component have to implement Serializable then.

This consumes more network bandwidth and less server memory. When setting the state saving to server, then the objects used won't be saved into the rendered HTML page. This consumes less network bandwidth and more server memory. My suggestion is to use the server side state saving.
[ December 25, 2006: Message edited by: Bauke Scholtz ]
Anthony Taylor

Joined: May 04, 2006
Posts: 26
I need to use these components in an ajax-enabled web site. I think the viewstate needs to be saved to the client in order to keep the viewstate current across multiple requests. I found information on how to pass the viewstate along to a .jsf page. Do you have any information on how to persist the viewstate peristent across multiple requests?
I agree. Here's the link:
subject: NotSerializableException + jsf custom components
It's not a secret anymore!