bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Validator.java
private static void validateXmlView(PageData xmlView, Compiler compiler)
	        throws JasperException {

	StringBuilder errMsg = null;
	ErrorDispatcher errDisp = compiler.getErrorDispatcher();

	for (Iterator<TagLibraryInfo> iter = 
                     compiler.getPageInfo().getTaglibs().iterator();
	         iter.hasNext(); ) {

	    TagLibraryInfo o = iter.next();
	    if (!(o instanceof TagLibraryInfoImpl))
		continue;
	    TagLibraryInfoImpl tli = (TagLibraryInfoImpl) o;

	    ValidationMessage[] errors = tli.validate(xmlView);
            if ((errors != null) && (errors.length != 0)) {
                if (errMsg == null) {
		    errMsg = new StringBuilder();
		}
                errMsg.append("<h3>");
                errMsg.append(Localizer.getMessage("jsp.error.tlv.invalid.page",
						   tli.getShortName()));
                errMsg.append("</h3>");
                for (int i=0; i<errors.length; i++) {
		    if (errors[i] != null) {
			errMsg.append("<p>");
			errMsg.append(errors[i].getId());
			errMsg.append(": ");
			errMsg.append(errors[i].getMessage());
			errMsg.append("</p>");
		    }
                }
            }
        }

	if (errMsg != null) {
            errDisp.jspError(errMsg.toString());
	}
    }
private static void validateXmlView(PageData xmlView, Compiler compiler)
	        throws JasperException {

	StringBuilder errMsg = null;
	ErrorDispatcher errDisp = compiler.getErrorDispatcher();

	for (Iterator<TagLibraryInfo> iter = 
                     compiler.getPageInfo().getTaglibs().iterator();
	         iter.hasNext(); ) {

	    TagLibraryInfo o = iter.next();
	    if (!(o instanceof TagLibraryInfoImpl))
		continue;
	    TagLibraryInfoImpl tli = (TagLibraryInfoImpl) o;

	    ValidationMessage[] errors = tli.validate(xmlView);
            if ((errors != null) && (errors.length != 0)) {
                if (errMsg == null) {
		    errMsg = new StringBuilder();
		}
                errMsg.append("<h3>");
                errMsg.append(Localizer.getMessage("jsp.error.tlv.invalid.page",
						   tli.getShortName()));
                errMsg.append("</h3>");
                for (int i=0; i<errors.length; i++) {
		    if (errors[i] != null) {
			errMsg.append("<p>");
			errMsg.append(errors[i].getId());
			errMsg.append(": ");
			errMsg.append(errors[i].getMessage());
			errMsg.append("</p>");
		    }
                }
            }
        }

	if (errMsg != null) {
            errDisp.jspError(errMsg.toString());
	}
    }
private static void validateXmlView ( PageData xmlView , Compiler compiler ) throws JasperException { StringBuilder errMsg = null ; ErrorDispatcher errDisp = compiler . getErrorDispatcher ( ) ; for ( Iterator < TagLibraryInfo > iter = compiler . getPageInfo ( ) . getTaglibs ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { TagLibraryInfo o = iter . next ( ) ; if ( ! ( o instanceof TagLibraryInfoImpl ) ) continue ; TagLibraryInfoImpl tli = ( TagLibraryInfoImpl ) o ; ValidationMessage [ ] errors = tli . validate ( xmlView ) ; if ( ( errors != null ) && ( errors . length != 0 ) ) { if ( errMsg == null ) { errMsg = new StringBuilder ( ) ; } errMsg . append ( "<h3>" ) ; errMsg . append ( Localizer . getMessage ( "jsp.error.tlv.invalid.page" , tli . getShortName ( ) ) ) ; errMsg . append ( "</h3>" ) ; for ( int i = 0 ; i < errors . length ; i ++ ) { if ( errors [ i ] != null ) { errMsg . append ( "<p>" ) ; errMsg . append ( errors [ i ] . getId ( ) ) ; errMsg . append ( ": " ) ; errMsg . append ( errors [ i ] . getMessage ( ) ) ; errMsg . append ( "</p>" ) ; } } } } if ( errMsg != null ) { errDisp . jspError ( errMsg . toString ( ) ) ; } }
Validate XML view against the TagLibraryValidator classes of all
imported tag libraries.
Validate XML view against the TagLibraryValidator classes of all imported tag libraries .