if(watermark.getFor() != null) {
String _for = watermark.getFor();
UIComponent forComponent = watermark.findComponent(_for);
if(forComponent == null) {
throw new FacesException("Cannot find component \"" + _for + "\" in view.");
}
target = ComponentUtils.escapeJQueryId(forComponent.getClientId(context));
} else if(watermark.getForElement() != null) {
target = watermark.getForElement();
} else {
throw new FacesException("Either for or forElement options must be used to define a watermark");
}
writer.startElement("script", null);
writer.writeAttribute("type", "text/javascript", null);