Shawn,
Oracle did something similar. Our solution was that we created a custom
FacesMessage which also took an enumeration of our allowed severity
types. These severity types could be mapped to the standard JSF
severity types (Confirmation was mapped to Severity.INFO for instance)
if a renderkit or something needed it in order to display the message.
We then added get and set methods for the message type.
Unfortunately JSF gives the illusion of being able to change the
severities easily, but the "ordinal" system that's in place in JSF does
not lend itself to this. Plus, many renderkits (like trinidad) use the
Severity in order to render messages on their components, so changing
them will break these renderkits.
Scott
Simon Kitching wrote:
Garner, Shawn wrote:
I need to create a custom message severity.
I wanted to create a confirmation message severity but Severity has a
private constructor?
Shouldn’t this be public so you can add your own?
I guess the API doesn't intend people to create custom severities.
The official javadocs are part of the JSF specification, and this page
doesn't indicate any public or protected constructor so MyFaces is
probably *required* not to provide one in order to be "JSF compliant":
http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/javax/faces/application/FacesMessage.Severity.html
Regards,
Simon