Package org.apache.commons.validator

Examples of org.apache.commons.validator.UrlValidator


                schemes[i++] = st.nextToken().trim();
            }
        }

        // Create UrlValidator and validate with options/schemes
        UrlValidator urlValidator = new UrlValidator(schemes, options);

        if (urlValidator.isValid(value)) {
            return true;
        } else {
            errors.add(field.getKey(),
                Resources.getActionMessage(validator, request, va, field));
View Full Code Here


        log.debug("transform 2 "+tranformedMessage);
        return tranformedMessage.toString();
    }

    private boolean validUrl(String token) {
        UrlValidator urlValidator = new UrlValidator();
        return urlValidator.isValid(token);
    }
View Full Code Here

     * @return if validate or not.
     */
    public static boolean validateUrl(final String url){
        final String[] schemes = {"http","https"};
        if (!EnMePlaceHolderConfigurer.getBooleanProperty("application.debug.mode")) {
            final UrlValidator urlValidator = new UrlValidator(schemes);
            return urlValidator.isValid(url);
        } else {
            return true;
        }
    }
View Full Code Here

    private final UrlValidator urlValidator;

    public WidgetValidator() {
        super();
        String[] allowedSchemes = {"http", "https"};
        urlValidator = new UrlValidator(allowedSchemes);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.validator.UrlValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.