Re: UrlValidator (why not use java.net.URL?)

2005-07-28 Thread Laurie Harper
oking into the code of UrlValidator and moreover looking into a similar class in Tapestry which is no longer active as it seems, i wonder why commons-validator UrlValidator is using Regex so much. Wouldnt it be enough to just use java.net.URL and let this class do the verification? Of course i a

Re: UrlValidator (why not use java.net.URL?)

2005-07-28 Thread Marc Logemann
Hi, after looking into the code of UrlValidator and moreover looking into a similar class in Tapestry which is no longer active as it seems, i wonder why commons-validator UrlValidator is using Regex so much. Wouldnt it be enough to just use java.net.URL and let this class do the

Re: UrlValidator

2005-07-28 Thread Marc Logemann
dress "127.0.0.1" but it would be nice to get this fixed. -Original Message- From: Marc Logemann [mailto:[EMAIL PROTECTED] Sent: Thursday, July 28, 2005 8:33 AM To: user@struts.apache.org Subject: UrlValidator Hi, can it be that UrlValidator from Commons-Validator doesnt vali

RE: UrlValidator

2005-07-28 Thread Lindholm, Greg
:33 AM To: user@struts.apache.org Subject: UrlValidator Hi, can it be that UrlValidator from Commons-Validator doesnt validate URLs with localhost in it? The following URL -> http://localhost:8081/context/jsp/versand_1.jsp breaks in isValidAuthority() within UrlValidator. It seems he tries to

UrlValidator

2005-07-28 Thread Marc Logemann
Hi, can it be that UrlValidator from Commons-Validator doesnt validate URLs with localhost in it? The following URL -> http://localhost:8081/context/jsp/versand_1.jsp breaks in isValidAuthority() within UrlValidator. It seems he tries to check for toplevel domain length and sees

Re: UrlValidator() takes options - but how?

2004-04-01 Thread Niall Pemberton
To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, April 01, 2004 3:24 PM Subject: Re: UrlValidator() takes options - but how? > Thanks for that Niall, you certainly know your stuff. > > I am thinking, if I change the UrlValidator in the source code, I cou

Re: UrlValidator() takes options - but how?

2004-04-01 Thread Niall Pemberton
The problem with GenericValidator is that it has a single instance of UrlValidator in a static variable, so you can't go changing its configuration every time a url is validated in your webapp as it wouldn't be thread safe. In fact if you want the option to configure it on a field by f

Re: UrlValidator() takes options - but how?

2004-04-01 Thread Adam Hardy
Thanks for that Niall, you certainly know your stuff. I am thinking, if I change the UrlValidator in the source code, I could submit a patch to allow FieldChecks to set the values from validation.xml. Currently, FieldChecks access UrlValidator via the GenericValidator: if

Re: UrlValidator() takes options - but how?

2004-04-01 Thread Niall Pemberton
UrlValidator is not the class that is instantiated by ValidatorAction because it doesn't know anything about Struts resources - the Struts FieldChecks.validateUrl() method calls commons GenericValidator which instantiates the UrlValidator. Rather than using the struts FieldChecks.valida

UrlValidator() takes options - but how?

2004-04-01 Thread Adam Hardy
In UrlValidator() in the validator package, one can set various options upon instantiation, such as ALLOW_2_SLASHES or NO_FRAGMENTS. However it appears from the code in ValidatorAction.getValidationClassInstance() that I can't actually set these at any point in the Validator framework so that