From: Adam Hardy I provide URL validation on a page which saves links for
users.
I put together the latest build of commons-validator (1.1.2) and struts (1.2) to see what the URL validation is like.
The class for server-side validation is in place, but the javascript doesn't exist.
It works very strictly, too strictly for me.
Most users will want to save links such as
http://www.google.com http://jakarta.apache.org/ http://marc.theaimsgroup.com/?l=struts-user&m=105511005106573&w=2
This is definately a bug and they should have passed,
I haven't run the unit tests against it in some time do they still
pass ?
My guess is that it might not be expecting the '/' after the domain name. This would probably only require a small tweak
to the regular expression thats used.
I would apply any patches that were submitted
I'm running the tests on the Validator via ant and I get this exception straight away. I assume that the bad date is a test date that is meant to fail - but I can't figure out the reason why junit is falling over. I've only got brief experience with junit and I'm not finding the relevant code.
Thanks for any pointers, Adam
[echo] Running tests ...
[java] .........................................
[java] ..........................F.......F...ValidatorTest.formatDate() - Unparseable date: "2/30/1999"
[java] .....
[java] Mar 15, 2004 9:49:58 AM org.apache.commons.validator.ValidatorAction executeValidationMethod
[java] SEVERE: Unhandled exception thrown during validation: RUNTIME-EXCEPTION
[java] java.lang.RuntimeException: RUNTIME-EXCEPTION
[java] at org.apache.commons.validator.TestValidator.validateRaiseException(TestValidator.java:53)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:324)
[java] at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:570)
-- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]