Work around JSF 1.1's inadequate Messages renderer, which has the following problems:
- Contrary to the documentation, an HTML list is not used to render a list. Instead,
the message texts are written out one after another.
- There's no way to define styles or classes for the containing HTML element.
- Each message is put into a "span" element rather than a "div". This means that
important formatting options are not available to page designers.
Of these, the worst problem seems the use of "span" instead of "div". Not many friendly
UIs will present messages to the user in a bulleted or numbered list, and since
each row only has one cell, the "table" capabilities aren't much different than one
would get from "div"s. So this overriding renderer uses "div" instead.
TODO Implement "table" and "list", and the trimmings ("detail", "title", etc.) to
make this a full replacement.
TODO Possibly add a TLD to make styling the container possible.
To replace the JSF renderer with no further fuss, just paste this into faces-config.xml :
Notes added by JH below:
This messages renderer will check in two places for faces messages: in the
faces context, and in the session-scoped messagesBean.