/** * method that validates an url address. * it uses the commons-validator */ public void validate( FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException { if (facesContext == null) throw new NullPointerException("facesContext"); if (uiComponent == null) throw new NullPointerException("uiComponent"); if (value == null) { return; } org.apache.commons.validator.UrlValidator urlValidator = initValidator(); if (!urlValidator.isValid(value.toString())) { Object[] args = {value.toString()}; throw new ValidatorException(getFacesMessage(URL_MESSAGE_ID, args)); } }
/** * method that validates an url address. * it uses the commons-validator */ public void validate( FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException { if (facesContext == null) throw new NullPointerException("facesContext"); if (uiComponent == null) throw new NullPointerException("uiComponent"); if (value == null) { return; } org.apache.commons.validator.UrlValidator urlValidator = initValidator(); if (!urlValidator.isValid(value.toString())) { Object[] args = {value.toString()}; throw new ValidatorException(getFacesMessage(URL_MESSAGE_ID, args)); } }
throw new ValidatorException(getFacesMessage(URL_MESSAGE_ID, args));