* javax.faces.context.FacesContext, javax.faces.component.UIComponent)
*/
@Override
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
AbstractMediaOutput mmedia = (AbstractMediaOutput) component;
String element = mmedia.getElement();
if (null == element) {
throw new FacesException(Messages.getMessage(Messages.NULL_ATTRIBUTE_ERROR, "element",
component.getClientId(context)));
}
String uriAttribute = mmedia.getUriAttribute();
// Check for pre-defined attributes
if (null == uriAttribute) {
uriAttribute = URI_ATTRIBUTES.get(element);
if (null == uriAttribute) {
throw new FacesException(Messages.getMessage(Messages.NULL_ATTRIBUTE_ERROR, "uriAttribute",
component.getClientId(context)));
}
}
writer.startElement(element, mmedia);
getUtils().encodeId(context, component);
StringBuilder uri = new StringBuilder(mmedia.getResource().getRequestPath());
// Append parameters to resource Uri
boolean haveQestion = uri.indexOf("?") >= 0;
for (UIComponent child : component.getChildren()) {