/** Process the init directive. */ private void parseInitDirective(PageDefinition pgdef, ProcessingInstruction pi, Map<String, String> params) throws Exception { final String clsnm = params.remove("class"); final String zsrc = params.remove("zscript"); final Map<String, String> args = new LinkedHashMap<String, String>(params); if (clsnm == null) { if (zsrc == null) throw new UiException(message("Either the class or zscript attribute must be specified", pi)); checkZScriptEnabled(pi.getLocator()); ZScript zs = null; final String zslang = pgdef.getZScriptLanguage(); if (!zsrc.contains("${")) { final URL url = getLocator().getResource(zsrc); if (url != null) zs = new ZScript(zslang, url); //Bug 2929887: defer the error message since it might not be required } if (zs == null) zs = new ZScript(pgdef.getEvaluatorRef(), zslang, zsrc, getLocator()); pgdef.addInitiatorInfo(new InitiatorInfo(new ZScriptInitiator(zs), args)); } else { if (zsrc != null) throw new UiException(message("You cannot specify both class and zscript", pi)); pgdef.addInitiatorInfo(new InitiatorInfo(clsnm, args)); } }