A DESCRIPTION OF THE REQUEST :
FacesMessage.Severity is a typesafe enumeration with the meaning to describe the
severity of an error message displayed using JSF. As a typesafe enumeration, it
is basically a simple class reference without any transient meaning. This class
is unfortunately not serializable.
In order to create error pages which contain jsf style error descriptions (a
summary, a detail, and a severity), it can be clever to add a FacesMessage as a
managed bean with e.g. session scope. As such, it will fail a web session to be
serialized e.g. in failover or server redeployment situations.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Make it serializable. Implement FacesMessage.Severity.readResolve as described
in Joshua Bloch, Effective Java Programming Language Guide, 2001, Addison
Wesley, Item 21.
CUSTOMER SUBMITTED WORKAROUND :
Store two strings regarding the error description. Hardcode or otherwise encode
(Due to the construction of FacesMessage, you cannot instantiate it with a null
Severity field without encountering a NPE)
- (#1 of 1): 2005-09-20 22:30:34 EDT firstname.lastname@example.org