Apache Commons UrlValidator

I have the following Java code:

UrlValidator urlValidator = new UrlValidator();
boolean validUrl = urlValidator.isValid("http://www.google.com");
System.out.println("result: " + validUrl);

When I run the above code, I always get:

result: false

Why does apache commons UrlValidator not consider "http://www.google.com" as valid? If I replace "http://www.google.com" with "http://www.google.com/index.php", I get "result: true". However, my users have legal uses for submitting URLs that do not end with a specific file name.

+3
source share
1 answer

You are using an outdated version of the public authentication tool. This bug was resolved after release 1.2.

(1.3.1), .

+4

Source: https://habr.com/ru/post/1768091/


All Articles