commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Reilly" <>
Subject [validator] UrlValidator
Date Wed, 28 Jul 2004 15:52:32 GMT
First, I'm a newbie with validator, so maybe I'm just not using it
I was hoping to use validator library to validate url strings from a form.
I'm finding the validation too strict for my use case. I have a form and
want to validate the the user entered a valid url in 'simple user' terms of

But...I added this test case to org.apache.commons.validator.UrlTest; the
url is valid from my POV.

   public void testSanity() {
       UrlValidator v = new UrlValidator();

But it fails.

Also testing with:
isValidScheme : false
isValidAuthority : false
isValidPath : false
isValidQuery : true
isValidFragment: true

Can anyone explain the UrlValidator.isValidXXXXX ?
Why would query and fragment be valid (I guess because they aren't
specified. I'm good with that.)
But can't port and path be optional not specified as well?
Also why is the scheme (http://) not valid?

Oddly, the url passes isValid(), but fails
isValidScheme(), etc..


(btw: Testing against HEAD / 1.1.3)

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message