if (context == null || component == null) {
throw new NullPointerException();
}
if (!component.isRendered()) return;
Messages comp = (Messages)component;
ResponseWriter writer = context.getResponseWriter();
MessagesIterator messagesIterator = new MessagesIterator(context, comp.isGlobalOnly());
if (messagesIterator.hasNext()) {
String layout = comp.getLayout();
if (layout == null || layout.equalsIgnoreCase(Attributes.LIST)) {
while(messagesIterator.hasNext()) {
renderMessage(context, comp, (FacesMessage)messagesIterator.next());