First, I'm a newbie with validator, so maybe I'm just not using it
correctly.
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
valid.
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();
assertTrue(v.isValid("http://www.google.com"));
}
But it fails.
Also testing http://www.google.com 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 http://www.google.com:80/test passes isValid(), but fails
isValidScheme(), etc..
Thanks,
-TR
(btw: Testing against HEAD / 1.1.3)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]