Example usage for javax.servlet.jsp.tagext TagLibraryValidator validate

List of usage examples for javax.servlet.jsp.tagext TagLibraryValidator validate

Introduction

In this page you can find the example usage for javax.servlet.jsp.tagext TagLibraryValidator validate.

Prototype

public ValidationMessage[] validate(String prefix, String uri, PageData page) 

Source Link

Document

Validate a JSP page.

Usage

From source file:org.apache.jasper.compiler.TagLibraryInfoImpl.java

/**
 * Translation-time validation of the XML document
 * associated with the JSP page./*from  w w  w .  j  ava2s.  co m*/
 * This is a convenience method on the associated 
 * TagLibraryValidator class.
 *
 * @param thePage The JSP page object
 * @return A string indicating whether the page is valid or not.
 */
public ValidationMessage[] validate(PageData thePage) {
    TagLibraryValidator tlv = getTagLibraryValidator();
    if (tlv == null)
        return null;

    String uri = getURI();
    if (uri.startsWith("/")) {
        uri = URN_JSPTLD + uri;
    }

    return tlv.validate(getPrefixString(), uri, thePage);
}

From source file:org.tinygroup.jspengine.compiler.TagLibraryInfoImpl.java

/**
 * Translation-time validation of the XML document
 * associated with the JSP page.//from  www. j  a v  a  2s. c om
 * This is a convenience method on the associated 
 * TagLibraryValidator class.
 *
 * @param thePage The JSP page object
 * @return A string indicating whether the page is valid or not.
 */
public ValidationMessage[] validate(PageData thePage) {
    TagLibraryValidator tlv = getTagLibraryValidator();
    if (tlv == null)
        return null;
    Map<String, Object> initParameters = tlv.getInitParameters();
    if (initParameters == null) {
        tlv.setInitParameters(new HashMap<String, Object>());
    }
    String uri = getURI();
    if (uri.startsWith("/")) {
        uri = URN_JSPTLD + uri;
    }

    ValidationMessage[] messages = tlv.validate(getPrefixString(), uri, thePage);
    tlv.release();

    return messages;
}