javax.servlet.jsp.tagext.TagLibraryValidator Java Examples

The following examples show how to use javax.servlet.jsp.tagext.TagLibraryValidator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TagLibraryInfoImpl.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
private TagLibraryValidator createValidator(ValidatorXml validatorXml) throws JasperException {

        if (validatorXml == null) {
            return null;
        }

        String validatorClass = validatorXml.getValidatorClass();
        if (validatorClass == null || validatorClass.isEmpty()) {
            return null;
        }

        Map<String,Object> initParams = new Hashtable<>();
        initParams.putAll(validatorXml.getInitParams());

        try {
            Class<?> tlvClass = ctxt.getClassLoader().loadClass(validatorClass);
            TagLibraryValidator tlv = (TagLibraryValidator) tlvClass.getConstructor().newInstance();
            tlv.setInitParameters(initParams);
            return tlv;
        } catch (Exception e) {
            err.jspError(e, "jsp.error.tlvclass.instantiation", validatorClass);
            return null;
        }
    }
 
Example #2
Source File: TagLibraryInfoImpl.java    From packagedrone with Eclipse Public License 1.0 6 votes vote down vote up
/**
    * Translation-time validation of the XML document
    * associated with the JSP page.
    * 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;
       }

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

       return messages;
   }
 
Example #3
Source File: TagLibraryInfoImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Translation-time validation of the XML document associated with the JSP
 * page. 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);
}
 
Example #4
Source File: TagLibraryInfoImpl.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
/**
 * Translation-time validation of the XML document associated with the JSP
 * page. 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);
}
 
Example #5
Source File: TagLibraryInfoImpl.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
/**
 * Translation-time validation of the XML document associated with the JSP
 * page. 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);
}
 
Example #6
Source File: TagLibraryInfoImpl.java    From Tomcat8-Source-Read with MIT License 2 votes vote down vote up
/**
 * The instance (if any) for the TagLibraryValidator class.
 *
 * @return The TagLibraryValidator instance, if any.
 */
public TagLibraryValidator getTagLibraryValidator() {
    return tagLibraryValidator;
}
 
Example #7
Source File: TagLibraryInfoImpl.java    From Tomcat7.0.67 with Apache License 2.0 2 votes vote down vote up
/**
 * The instance (if any) for the TagLibraryValidator class.
 * 
 * @return The TagLibraryValidator instance, if any.
 */
public TagLibraryValidator getTagLibraryValidator() {
    return tagLibraryValidator;
}
 
Example #8
Source File: TagLibraryInfoImpl.java    From tomcatsrc with Apache License 2.0 2 votes vote down vote up
/**
 * The instance (if any) for the TagLibraryValidator class.
 * 
 * @return The TagLibraryValidator instance, if any.
 */
public TagLibraryValidator getTagLibraryValidator() {
    return tagLibraryValidator;
}
 
Example #9
Source File: TagLibraryInfoImpl.java    From packagedrone with Eclipse Public License 1.0 2 votes vote down vote up
/**
    * The instance (if any) for the TagLibraryValidator class.
    * 
    * @return The TagLibraryValidator instance, if any.
    */
   public TagLibraryValidator getTagLibraryValidator() {
return tagLibraryValidator;
   }