title: The type UrlValidator is deprecated
body: <p>i'm writing a custom validator to check the url entered by the user :</p>
  
  <pre><code>package tn.talan.testFramework.validators;
  
  import javax.faces.application.FacesMessage;
  import javax.faces.component.UIComponent;
  import javax.faces.context.FacesContext;
  
  import javax.faces.validator.Validator;
  import javax.faces.validator.ValidatorException;
  
  import org.apache.commons.validator.UrlValidator;
  
  
  
  
  
    public class URLCustomValidator implements Validator{
  
  public void validate(FacesContext context, UIComponent component,Object value) throws ValidatorException {
  
      String enteredURL = (String) value;
      String[] schemes = {"http","https"};
      System.out.println(enteredURL);
      FacesMessage message = null ;
      String messageStr = null ;
  
              UrlValidator urlValidator = new UrlValidator(schemes);
  
  
             if (!urlValidator.isValid(enteredURL)) {
                 System.out.println("url is invalid valid");
                 message = new FacesMessage();
                 messageStr = (String)component.getAttributes().get("message");
                 if (messageStr == null) {
  
                      messageStr = "Inavalid URL";
  
                    }
                    message.setDetail(messageStr);
  
                    message.setSummary(messageStr);
  
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
  
                    throw new ValidatorException(message);
                 } 
  
  
  
  
  
  
            }
  
  }
  </code></pre>
  
  <p>I get this warning and i want to solve it :</p>
  
  <pre><code>The type UrlValidator is deprecated
  </code></pre>
  
  <p>Thank u in advance</p>