I'd posted this to commons-user back in July, never got an answer and went on with my reqs using a regex instead. I saw Martin's post today on a 1.1.3 release and figured I should I forward this to see if it was a bug or only that fully 'resolved' urls are valid or something and I was using incorrectly?
> -----Original Message----- > From: Tim Reilly > Sent: Wednesday, July 28, 2004 11:53 AM > To: [EMAIL PROTECTED] > Subject: [validator] UrlValidator > > > 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/method 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]