if (context == null || component == null) {
throw new NullPointerException();
}
if (!component.isRendered()) return;
GraphicImage comp = (GraphicImage)component;
String contextPath = context.getExternalContext().getRequestContextPath();
//String url = (String)component.getAttributes().get("url");
ResponseWriter writer = context.getResponseWriter();
writer.startElement(Attributes.IMG, comp);
RendererUtils.writeAttribute(Attributes.ID, comp.getClientId(context), writer);
RendererUtils.writeAttribute(Attributes.STYLE_CLASS, comp.getStyleClass(), writer);
RendererUtils.writeAttribute(Attributes.XML_LANG, comp.getXmllang(), writer);
RendererUtils.writeAttribute(Attributes.ALT, comp.getAlt(), writer);
// src
String url = null;
if (comp.getValue() != null) url = (String)comp.getValue(); // 'value' have a priority
else if (comp.getUrl() != null) url = (String)comp.getUrl();
RendererUtils.writeAttribute(Attributes.SRC, getURL(context, url), writer);
RendererUtils.writeAttribute(Attributes.LOCAL_SRC, comp.getLocalsrc(), writer);
RendererUtils.writeAttribute(Attributes.VSPACE, comp.getVspace(), writer);
RendererUtils.writeAttribute(Attributes.HSPACE, comp.getHspace(), writer);
RendererUtils.writeAttribute(Attributes.ALIGN, comp.getAlign(), writer);
RendererUtils.writeAttribute(Attributes.HEIGHT, comp.getHeight(), writer);
RendererUtils.writeAttribute(Attributes.WIDTH, comp.getWidth(), writer);
writer.endElement(Attributes.IMG);
}