简体   繁体   中英

HtmlInputHidden with java.io.NotSerializableException

I changed the context param javax.faces.STATE_SAVING_METHOD from server to client in my JSF application but now I get:

java.io.NotSerializableException: javax.faces.component.html.HtmlInputHidden

This breaks the view rendering.

As HtmlInputHidden is from a third party jar, I can't implement it myself.

Is there any way to solve such problem?

Solved with transient keyword in HtmlInputHidden declaration:

private transient HtmlInputHidden htmlInputHidden;

As @millimoose said, saveSate() method controls the state; not the serialization.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM