// Since it must be a fragment id all we need to do is remove the #.
String handlerId = handlerAttribute.substring(1);
// Then we look up the handler to see if it has been defined. If it
// has not this is an error.
final MarinerPageContext pageContext = getPageContext(context);
HandlerScriptRegistry scriptRegistry =
pageContext.getHandlerScriptRegistry();
ScriptAssetReference handlerScript =
scriptRegistry.getScriptById(handlerId);
if (handlerScript == null) {
throw new IllegalArgumentException("Handler attribute " +
handlerAttribute + "must refer to a defined handler " +
"element");
}